@shophost/react 2.0.44 → 2.0.46
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/admin-client.cjs +1 -1
- package/admin-client.js +617 -617
- package/package.json +3 -3
- package/react.css +1 -1
- package/storefront/lib/storefront-appearance.d.ts +1 -1
package/admin-client.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as i, Fragment as C } from "react/jsx-runtime";
|
|
3
3
|
import { QueryClient as di, QueryClientProvider as ci, useQuery as Q, keepPreviousData as he, useMutation as L } from "@tanstack/react-query";
|
|
4
|
-
import { ThemeProvider as
|
|
4
|
+
import { ThemeProvider as Ss, useTheme as Is } from "next-themes";
|
|
5
5
|
import * as A from "react";
|
|
6
|
-
import S, { createContext as Ce, useContext as ge, useMemo as ce, useState as F, useReducer as
|
|
7
|
-
import O, { Toaster as
|
|
6
|
+
import S, { createContext as Ce, useContext as ge, useMemo as ce, useState as F, useReducer as Es, useEffect as ee, useCallback as V, useRef as mi, Fragment as ca, useId as Fe, forwardRef as ui } from "react";
|
|
7
|
+
import O, { Toaster as zs } from "react-hot-toast";
|
|
8
8
|
import { inferAdditionalFields as pi, organizationClient as hi } from "better-auth/client/plugins";
|
|
9
9
|
import { createAuthClient as gi } from "better-auth/react";
|
|
10
|
-
import { useFormContext as fi, useFormState as ct, useForm as me, FormProvider as Ue, useFieldArray as
|
|
11
|
-
import { Search as
|
|
10
|
+
import { useFormContext as fi, useFormState as ct, useForm as me, FormProvider as Ue, useFieldArray as Gt } from "react-hook-form";
|
|
11
|
+
import { Search as Kt, ChevronDown as na, Check as Ea, MailIcon as Ds, XIcon as mt, CloudUpload as Ya, Loader2 as Fs, Phone as yi, X as za, LanguagesIcon as bi, ChevronLeft as Da, ShoppingBasketIcon as xi, UserIcon as Xa, LayoutDashboardIcon as Rs, ShoppingBagIcon as ma, CalendarDaysIcon as ta, LogOutIcon as Bs, ArrowRightIcon as Ms, PartyPopperIcon as Ps, CopyIcon as Qs, AtSign as Ts, PlusCircleIcon as Js, XCircleIcon as Os, PlusIcon as Te, CheckCircle as ut, ArrowRight as Ls, CheckIcon as pt, EyeOffIcon as wi, PencilIcon as ki, Trash2 as Yt, TrashIcon as js, BookCopyIcon as Pr, ExternalLinkIcon as Vs, ChevronRightIcon as Zs, HomeIcon as vi, RadioIcon as Ni, LogsIcon as Ai, CalendarCheckIcon as Ci, PackageIcon as Si, BoxesIcon as Ii, FactoryIcon as Ei, UserCircleIcon as Hs } from "lucide-react";
|
|
12
12
|
import { upload as zi } from "@vercel/blob/client";
|
|
13
13
|
import ve from "next/image.js";
|
|
14
14
|
import { useDebounce as qe } from "use-debounce";
|
|
15
15
|
import x from "classnames";
|
|
16
|
-
import { withMask as
|
|
17
|
-
import { Transition as Di, Dialog as
|
|
16
|
+
import { withMask as Us } from "use-mask-input";
|
|
17
|
+
import { Transition as Di, Dialog as qs, TransitionChild as Qr, DialogPanel as Ws } from "@headlessui/react";
|
|
18
18
|
import E from "next/link.js";
|
|
19
|
-
import { RiCloseLine as Fi, RiLoader2Fill as Ri, RiSearchLine as
|
|
19
|
+
import { RiCloseLine as Fi, RiLoader2Fill as Ri, RiSearchLine as Xt, RiEyeFill as Bi, RiEyeOffFill as Mi, RiGoogleFill as ht, RiArrowLeftDoubleLine as Pi, RiArrowLeftSLine as Qi, RiArrowRightSLine as gt, RiArrowRightDoubleLine as Ti, RiCalendar2Fill as _s, RiSubtractFill as $s, RiRefreshLine as Gs, RiMoneyDollarCircleLine as Ks, RiShoppingBag3Line as Ys, RiCalendarCheckLine as Xs, RiGroupLine as el, RiArrowUpSLine as Ji, RiArrowDownSLine as er, RiCheckLine as ft, RiRadioButtonFill as al, RiCheckboxBlankCircleLine as tl, RiMoreFill as yt, RiSettings5Line as Oi, RiMenuLine as rl, RiExpandUpDownLine as Li, RiSunLine as il, RiMoonLine as nl, RiComputerLine as sl, RiMore2Fill as ll } from "@remixicon/react";
|
|
20
20
|
import { useRouter as _, useSearchParams as fe, usePathname as We, useParams as ji, notFound as ea } from "next/navigation.js";
|
|
21
21
|
import { zodResolver as ue } from "@hookform/resolvers/zod";
|
|
22
|
-
import { isValid as
|
|
23
|
-
import { initClient as
|
|
22
|
+
import { isValid as ar, format as q, addYears as Oa, subDays as Tr, endOfDay as ol, startOfDay as dl } from "date-fns";
|
|
23
|
+
import { initClient as cl } from "@shophost/client";
|
|
24
24
|
import { z as m } from "@hono/zod-openapi";
|
|
25
|
-
import { Slot as
|
|
25
|
+
import { Slot as tr } from "@radix-ui/react-slot";
|
|
26
26
|
import { tv as Le } from "tailwind-variants";
|
|
27
27
|
import Vi from "clsx";
|
|
28
28
|
import { twMerge as Zi } from "tailwind-merge";
|
|
29
29
|
import * as Hi from "@radix-ui/react-label";
|
|
30
|
-
import { ResponsiveContainer as La, AreaChart as
|
|
30
|
+
import { ResponsiveContainer as La, AreaChart as ml, CartesianGrid as Ot, XAxis as Lt, YAxis as jt, Tooltip as ja, Area as ul, BarChart as Jr, Bar as Or, PieChart as pl, Pie as hl, Cell as gl } from "recharts";
|
|
31
31
|
import { Time as ie } from "@internationalized/date";
|
|
32
32
|
import * as G from "@radix-ui/react-popover";
|
|
33
|
-
import { useTimeField as
|
|
34
|
-
import { useTimeFieldState as
|
|
35
|
-
import { enUS as
|
|
36
|
-
import { DayPicker as Va, useNavigation as
|
|
33
|
+
import { useTimeField as fl, useDateSegment as yl } from "@react-aria/datepicker";
|
|
34
|
+
import { useTimeFieldState as bl } from "@react-stately/datepicker";
|
|
35
|
+
import { enUS as xl } from "date-fns/locale";
|
|
36
|
+
import { DayPicker as Va, useNavigation as wl } from "react-day-picker";
|
|
37
37
|
import { Command as Z } from "cmdk";
|
|
38
38
|
import * as $ from "@radix-ui/react-dialog";
|
|
39
39
|
import * as bt from "react-phone-number-input";
|
|
40
40
|
import Ui from "react-phone-number-input/flags";
|
|
41
41
|
import * as et from "@radix-ui/react-switch";
|
|
42
|
-
import * as
|
|
43
|
-
import
|
|
42
|
+
import * as rr from "@radix-ui/react-radio-group";
|
|
43
|
+
import kl from "tailwindcss/colors";
|
|
44
44
|
import * as at from "@radix-ui/react-navigation-menu";
|
|
45
|
-
import { useReactTable as vl, getSortedRowModel as Nl, getCoreRowModel as Al, getFilteredRowModel as Cl, flexRender as
|
|
46
|
-
import * as
|
|
45
|
+
import { useReactTable as vl, getSortedRowModel as Nl, getCoreRowModel as Al, getFilteredRowModel as Cl, flexRender as Lr, createColumnHelper as ua } from "@tanstack/react-table";
|
|
46
|
+
import * as jr from "@radix-ui/react-checkbox";
|
|
47
47
|
import * as oe from "@radix-ui/react-dropdown-menu";
|
|
48
48
|
import * as ae from "@radix-ui/react-select";
|
|
49
|
-
const se = new di({ defaultOptions: { queries: { retry: !1, refetchInterval: !1, refetchOnWindowFocus: !1 } } }),
|
|
50
|
-
const r = ce(() =>
|
|
51
|
-
return e(
|
|
49
|
+
const se = new di({ defaultOptions: { queries: { retry: !1, refetchInterval: !1, refetchOnWindowFocus: !1 } } }), qi = Ce(null), Wi = ({ baseUrl: a, children: t }) => {
|
|
50
|
+
const r = ce(() => cl({ baseUrl: a, throwOnUnknownStatus: !0, baseHeaders: {}, credentials: "include" }), [a]);
|
|
51
|
+
return e(qi.Provider, { value: { client: r, baseUrl: a }, children: t });
|
|
52
52
|
}, I = () => {
|
|
53
|
-
const a = ge(
|
|
53
|
+
const a = ge(qi);
|
|
54
54
|
if (!a) throw new Error("useAPI must be used within a APIProvider");
|
|
55
55
|
return a;
|
|
56
|
-
},
|
|
56
|
+
}, _i = Ce(null), Sl = ({ client: a, children: t }) => e(_i.Provider, { value: a, children: t });
|
|
57
57
|
function Fa() {
|
|
58
|
-
const a = ge(
|
|
58
|
+
const a = ge(_i);
|
|
59
59
|
if (!a) throw new Error("useAdminAuth must be used within AdminProvider");
|
|
60
60
|
return a;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
function
|
|
64
|
-
const a = ge(
|
|
62
|
+
const $i = Ce(null), Il = ({ config: a, children: t }) => e($i.Provider, { value: a, children: t });
|
|
63
|
+
function Gi() {
|
|
64
|
+
const a = ge($i);
|
|
65
65
|
if (!a) throw new Error("useAdminConfig must be used within AdminProvider");
|
|
66
66
|
return a;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const Ki = Ce(null), El = ({ routes: a, children: t }) => e(Ki.Provider, { value: a, children: t });
|
|
69
69
|
function K() {
|
|
70
|
-
const a = ge(
|
|
70
|
+
const a = ge(Ki);
|
|
71
71
|
if (!a) throw new Error("useAdminRoutes must be used within AdminProvider");
|
|
72
72
|
return a;
|
|
73
73
|
}
|
|
@@ -82,11 +82,11 @@ function Fl(a) {
|
|
|
82
82
|
const t = a.replace(/\/$/, "");
|
|
83
83
|
return { home: t, signIn: `${t}/auth/sign-in`, signUp: `${t}/auth/sign-up`, organizations: `${t}/organizations`, dashboard: (r) => `${t}/${r}/dashboard`, liveOrders: (r) => `${t}/${r}/live-orders`, orders: (r) => `${t}/${r}/orders`, reservations: (r) => `${t}/${r}/reservations`, products: (r) => `${t}/${r}/products`, productCreate: (r) => `${t}/${r}/products/create`, productEdit: (r, n) => `${t}/${r}/products/${n}`, productCategories: (r) => `${t}/${r}/product-categories`, productCategoryCreate: (r) => `${t}/${r}/product-categories/create`, productCategoryEdit: (r, n) => `${t}/${r}/product-categories/${n}`, manufacturers: (r) => `${t}/${r}/manufacturers`, manufacturerCreate: (r) => `${t}/${r}/manufacturers/create`, manufacturerEdit: (r, n) => `${t}/${r}/manufacturers/${n}`, settings: (r) => `${t}/${r}/settings`, settingsOpeningTimes: (r) => `${t}/${r}/settings/opening-times`, settingsShippingMethods: (r) => `${t}/${r}/settings/shipping-methods`, settingsShippingMethodCreate: (r) => `${t}/${r}/settings/shipping-methods/create`, settingsShippingMethodEdit: (r, n) => `${t}/${r}/settings/shipping-methods/${n}`, settingsAccess: (r) => `${t}/${r}/settings/access`, settingsAccessInvite: (r) => `${t}/${r}/settings/access/invite`, settingsAccessMemberEdit: (r, n) => `${t}/${r}/settings/access/${n}` };
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Xu({ config: a, children: t }) {
|
|
86
86
|
const r = ce(() => Dl(a.apiBaseUrl), [a.apiBaseUrl]), n = ce(() => Fl(a.basePath), [a.basePath]);
|
|
87
|
-
return e(ci, { client: se, children: i("div", { className: "shophost-admin", children: [e(
|
|
87
|
+
return e(ci, { client: se, children: i("div", { className: "shophost-admin", children: [e(Ss, { defaultTheme: "light", attribute: "class", children: e(Wi, { baseUrl: a.apiBaseUrl, children: e(Sl, { client: r, children: e(Il, { config: a, children: e(El, { routes: n, children: t }) }) }) }) }), e(zs, {})] }) });
|
|
88
88
|
}
|
|
89
|
-
const
|
|
89
|
+
const Vr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal: null, totalAmount: 0, itemCount: 0, removedItemsAlert: !1 }, ep = (a, t) => a.reduce((r, n) => {
|
|
90
90
|
const s = t(n.productId);
|
|
91
91
|
if (!s) return r;
|
|
92
92
|
const l = n.quantity || 1;
|
|
@@ -102,7 +102,7 @@ const jr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal:
|
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
}), r + o;
|
|
105
|
-
}, 0), we = (a, t = "USD", r = "en-US") => new Intl.NumberFormat(r, { style: "currency", currency: t }).format(a),
|
|
105
|
+
}, 0), we = (a, t = "USD", r = "en-US") => new Intl.NumberFormat(r, { style: "currency", currency: t }).format(a), ap = (a, t, r = "en-US") => {
|
|
106
106
|
const n = t(a.productId);
|
|
107
107
|
return !n || !a.modifierGroups || a.modifierGroups.length === 0 ? "" : a.modifierGroups.filter((s) => s && s.modifiers).map((s) => {
|
|
108
108
|
var u, c, h, p;
|
|
@@ -116,7 +116,7 @@ const jr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal:
|
|
|
116
116
|
}).filter(Boolean).join(", ");
|
|
117
117
|
return o ? `${o}: ${d}` : d;
|
|
118
118
|
}).filter(Boolean).join(" | ");
|
|
119
|
-
},
|
|
119
|
+
}, tp = (a, t, r) => a.find((n) => xt(n, { productId: t, modifierGroups: r })), xt = (a, t) => {
|
|
120
120
|
if (a.productId !== t.productId) return !1;
|
|
121
121
|
const r = t.modifierGroups ?? [], n = a.modifierGroups ?? [];
|
|
122
122
|
return r.length === 0 ? n.length === 0 : Bl(n, r);
|
|
@@ -134,7 +134,7 @@ const jr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal:
|
|
|
134
134
|
});
|
|
135
135
|
return s >= 0 ? (r.splice(s, 1), !0) : !1;
|
|
136
136
|
});
|
|
137
|
-
},
|
|
137
|
+
}, rp = (a) => !a.modifierGroups || a.modifierGroups.length === 0 ? !1 : a.modifierGroups.some((t) => t.selectMin > 0), Ml = (a, t) => {
|
|
138
138
|
var r, n, s;
|
|
139
139
|
if (a.length === 0) return { valid: !0 };
|
|
140
140
|
for (const l of a) {
|
|
@@ -153,7 +153,7 @@ const jr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal:
|
|
|
153
153
|
var o;
|
|
154
154
|
return !!((o = n.modifiers) != null && o.find((d) => d.id === l.id));
|
|
155
155
|
}) : !1;
|
|
156
|
-
}),
|
|
156
|
+
}), Yi = (a, t) => {
|
|
157
157
|
switch (t.type) {
|
|
158
158
|
case "INITIALIZE_CART": {
|
|
159
159
|
const r = t.payload;
|
|
@@ -167,7 +167,7 @@ const jr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal:
|
|
|
167
167
|
}
|
|
168
168
|
case "UPDATE_ITEM_QUANTITY": {
|
|
169
169
|
const { productId: r, quantity: n, modifierGroups: s } = t.payload;
|
|
170
|
-
if (n <= 0) return
|
|
170
|
+
if (n <= 0) return Yi(a, { type: "REMOVE_ITEM", payload: { productId: r, modifierGroups: s } });
|
|
171
171
|
const l = Ql(a.items, { productId: r, modifierGroups: s }, n);
|
|
172
172
|
return { ...a, items: l, itemCount: sa(l) };
|
|
173
173
|
}
|
|
@@ -205,7 +205,7 @@ const jr = "shophost-cart", Rl = { items: [], isInitialized: !1, modifierModal:
|
|
|
205
205
|
return a;
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
|
-
function
|
|
208
|
+
function Xi(a, t, r, n) {
|
|
209
209
|
const s = Number(t.discountedBasePrice ?? t.basePrice ?? 0), l = we((a.quantity || 1) * s, r, n), o = a.modifierGroups ? a.modifierGroups.map((u) => {
|
|
210
210
|
const c = t.modifierGroups.find((p) => p.id === u.id);
|
|
211
211
|
if (!c) return null;
|
|
@@ -218,19 +218,19 @@ function en(a, t, r, n) {
|
|
|
218
218
|
}).filter(Boolean) : [], d = t.images && t.images.length > 0 ? t.images[0] : void 0;
|
|
219
219
|
return { title: t.title ?? t.slug ?? "Untitled product", subtitle: o, image: d, price: l, unitPrice: we(s, r, n), quantity: a.quantity || 1 };
|
|
220
220
|
}
|
|
221
|
-
const
|
|
221
|
+
const en = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organizationId: r }) => {
|
|
222
222
|
const { client: n } = I(), s = Q({ queryKey: ["organization", r], queryFn: async () => {
|
|
223
223
|
const l = await n.organization.getOrganization({ params: { organizationId: r } });
|
|
224
224
|
if (l.status !== 200) throw new Error("Failed to fetch product data");
|
|
225
225
|
return l.body;
|
|
226
226
|
}, initialData: t ?? void 0, placeholderData: he, enabled: !!r });
|
|
227
|
-
return e(
|
|
227
|
+
return e(en.Provider, { value: { organizationId: r, loading: s.isLoading, organization: s.data, error: s.error }, children: a });
|
|
228
228
|
}, Ne = () => {
|
|
229
|
-
const a = ge(
|
|
229
|
+
const a = ge(en);
|
|
230
230
|
if (a === void 0) throw new Error("useOrganization must be used within a OrganizationProvider");
|
|
231
231
|
return a;
|
|
232
|
-
},
|
|
233
|
-
const { organization: n } = Ne(), s = n == null ? void 0 : n.configuration.defaultCurrency, { client: l } = I(), [o, d] = F(null), [u, c] = F(null), [{ items: h, isInitialized: p, modifierModal: g, totalAmount: b, itemCount: f, removedItemsAlert: w }, y] =
|
|
232
|
+
}, ir = Ce(void 0), jl = ({ children: a, locale: t = "en", organizationId: r }) => {
|
|
233
|
+
const { organization: n } = Ne(), s = n == null ? void 0 : n.configuration.defaultCurrency, { client: l } = I(), [o, d] = F(null), [u, c] = F(null), [{ items: h, isInitialized: p, modifierModal: g, totalAmount: b, itemCount: f, removedItemsAlert: w }, y] = Es(Yi, Rl), k = g !== null, v = (g == null ? void 0 : g.product) ?? null, N = (g == null ? void 0 : g.quantity) ?? 1, R = g == null ? void 0 : g.onAdded, T = ce(() => [...new Set(h.map((M) => M.productId))], [h]), { data: D, isLoading: H, isRefetching: le } = Q({ queryKey: ["cartProducts", T, f, u == null ? void 0 : u.id], queryFn: async () => {
|
|
234
234
|
if (T.length === 0) return { products: {}, total: 0, subtotal: 0, invalidProductIds: [] };
|
|
235
235
|
const M = await l.cart.getCartData({ params: { organizationId: r }, query: { locale: t }, body: { items: h, shippingMethodId: u == null ? void 0 : u.id } });
|
|
236
236
|
if (M.status !== 200) throw new Error("Failed to fetch product data");
|
|
@@ -241,7 +241,7 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
241
241
|
D && ((M = D.invalidProductIds) == null ? void 0 : M.length) > 0 && (y({ type: "REMOVE_INVALID_PRODUCTS", payload: { invalidProductIds: D.invalidProductIds } }), alert("Some items have been removed from your cart because they are no longer available or their options have changed."));
|
|
242
242
|
}, [D, le, h.length]), ee(() => {
|
|
243
243
|
(() => {
|
|
244
|
-
const M = localStorage.getItem(
|
|
244
|
+
const M = localStorage.getItem(Vr);
|
|
245
245
|
if (M) try {
|
|
246
246
|
const j = JSON.parse(M);
|
|
247
247
|
y({ type: "INITIALIZE_CART", payload: j });
|
|
@@ -251,7 +251,7 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
251
251
|
y({ type: "SET_INITIALIZED", payload: !0 });
|
|
252
252
|
})();
|
|
253
253
|
}, []), ee(() => {
|
|
254
|
-
p && localStorage.setItem(
|
|
254
|
+
p && localStorage.setItem(Vr, JSON.stringify(h));
|
|
255
255
|
}, [h, p]), ee(() => {
|
|
256
256
|
h.length > 0 && D && y({ type: "UPDATE_TOTALS", payload: { productsData: D.products } });
|
|
257
257
|
}, [h, D]);
|
|
@@ -272,11 +272,11 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
272
272
|
y({ type: "CLOSE_MODIFIERS_MODAL" });
|
|
273
273
|
}, []), Ja = ce(() => D != null && D.products ? h.map((M) => {
|
|
274
274
|
const j = D.products[M.productId];
|
|
275
|
-
return j ?
|
|
275
|
+
return j ? Xi(M, j, s ?? "USD", t) : null;
|
|
276
276
|
}).filter((M) => M !== null) : [], [h, D == null ? void 0 : D.products, s, t]), te = ce(() => ({ locale: t, organizationId: r, items: h, total: (D == null ? void 0 : D.total) ?? 0, shipping: D == null ? void 0 : D.shipping, subtotal: (D == null ? void 0 : D.subtotal) ?? 0, products: (D == null ? void 0 : D.products) || {}, addItem: B, removeItem: Se, updateItemQuantity: J, clearCart: wa, itemCount: f, totalAmount: b, onCheckoutClick: Ta, openModifiersModal: ka, closeModifiersModal: va, modifierModal: g, isModifiersModalOpen: k, selectedProduct: v, pendingModalQuantity: N, onModalAddToCart: R, isProductsLoading: H, paymentMethod: o, setPaymentMethod: d, shippingMethod: u, setShippingMethod: c, formattedCartItems: Ja }), [t, r, h, B, Se, J, wa, f, b, Ta, ka, va, g, k, v, N, R, D, H, o, d, u, c, Ja]);
|
|
277
|
-
return e(
|
|
278
|
-
},
|
|
279
|
-
const a = ge(
|
|
277
|
+
return e(ir.Provider, { value: te, children: a });
|
|
278
|
+
}, nr = () => {
|
|
279
|
+
const a = ge(ir), { client: t } = I();
|
|
280
280
|
if (a === void 0) throw new Error("useCart must be used within a CartProvider");
|
|
281
281
|
const r = V(async (d, u) => {
|
|
282
282
|
if (u) return u;
|
|
@@ -297,8 +297,8 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
297
297
|
a.removeItem(d, u);
|
|
298
298
|
}, [a]), o = V((d) => n({ productId: d.id, product: d }), [n]);
|
|
299
299
|
return { items: a.items, total: a.total, subtotal: a.subtotal, shipping: a.shipping, loading: a.isProductsLoading, formattedCartItems: a.formattedCartItems, add: n, update: s, remove: l, addProductToCart: o, clearCart: a.clearCart, itemCount: a.itemCount, rawCart: a.items, onCheckoutClick: a.onCheckoutClick, totalAmount: a.totalAmount, paymentMethod: a.paymentMethod, setPaymentMethod: a.setPaymentMethod, shippingMethod: a.shippingMethod, setShippingMethod: a.setShippingMethod };
|
|
300
|
-
},
|
|
301
|
-
const a = ge(
|
|
300
|
+
}, sr = () => {
|
|
301
|
+
const a = ge(ir);
|
|
302
302
|
if (a === void 0) throw new Error("useCart must be used within a CartProvider");
|
|
303
303
|
return a;
|
|
304
304
|
}, Vl = (a = "en") => {
|
|
@@ -310,7 +310,7 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
310
310
|
return g && g[c] ? g[c] : h;
|
|
311
311
|
}, [t]), s = V((u, c = "Product") => n(u == null ? void 0 : u.translations, "title", c), [n]), l = V((u, c = "") => n(u == null ? void 0 : u.translations, "description", c), [n]), o = V((u, c = "Category") => n(u == null ? void 0 : u.translations, "title", c), [n]), d = V((u, c = "Options") => u.title, [n]);
|
|
312
312
|
return { locale: t, setLocale: r, getTranslation: n, getProductName: s, getProductDescription: l, getCategoryName: o, getModifierGroupName: d };
|
|
313
|
-
}, Zl = (a) => a.map((t) => ({ groupId: t.id, modifierIds: [] })),
|
|
313
|
+
}, Zl = (a) => a.map((t) => ({ groupId: t.id, modifierIds: [] })), Zr = (a, t, r) => {
|
|
314
314
|
const n = a.findIndex((s) => s.groupId === t);
|
|
315
315
|
return n === -1 ? [...a, { groupId: t, modifierIds: r([]) }] : a.map((s, l) => l === n ? { ...s, modifierIds: r(s.modifierIds) } : s);
|
|
316
316
|
}, Hl = (a = []) => {
|
|
@@ -319,9 +319,9 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
319
319
|
r(Zl(a)), s(null);
|
|
320
320
|
}, [a]);
|
|
321
321
|
const l = V((p, g) => {
|
|
322
|
-
r((b) =>
|
|
322
|
+
r((b) => Zr(b, p, (f) => f.includes(g) ? f.filter((w) => w !== g) : [...f, g])), s(null);
|
|
323
323
|
}, []), o = V((p, g) => {
|
|
324
|
-
r((b) =>
|
|
324
|
+
r((b) => Zr(b, p, () => [g])), s(null);
|
|
325
325
|
}, []), d = V((p, g) => {
|
|
326
326
|
const b = t.find((f) => f.groupId === p);
|
|
327
327
|
return b ? b.modifierIds.includes(g) : !1;
|
|
@@ -330,8 +330,8 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
330
330
|
return !p.valid && p.message ? s(p.message) : s(null), p.valid;
|
|
331
331
|
}, [a, t]), c = ce(() => t.filter((p) => p.modifierIds.length > 0).map((p) => ({ id: p.groupId, modifiers: p.modifierIds.map((g) => ({ id: g, quantity: 1 })) })), [t]), h = V(() => c, [c]);
|
|
332
332
|
return { selections: t, toggleModifier: l, selectModifier: o, isModifierSelected: d, validateSelections: u, validationError: n, getCartModifierGroups: h };
|
|
333
|
-
},
|
|
334
|
-
const { modifierModal: r, closeModifiersModal: n, addItem: s } =
|
|
333
|
+
}, an = Ce(null), tn = ({ children: a, locale: t = "en" }) => {
|
|
334
|
+
const { modifierModal: r, closeModifiersModal: n, addItem: s } = sr(), l = (r == null ? void 0 : r.product) ?? null, o = ce(() => (l == null ? void 0 : l.modifierGroups) ?? [], [l]), [d, u] = F(1), { toggleModifier: c, selectModifier: h, isModifierSelected: p, validateSelections: g, validationError: b, getCartModifierGroups: f } = Hl(o), { getProductName: w, getModifierGroupName: y } = Vl(t);
|
|
335
335
|
ee(() => {
|
|
336
336
|
u((r == null ? void 0 : r.quantity) ?? 1);
|
|
337
337
|
}, [r]);
|
|
@@ -343,17 +343,17 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
343
343
|
var B;
|
|
344
344
|
!l || !g() || (s({ productId: l.id, quantity: d, modifierGroups: f() }), u(1), n(), (B = r == null ? void 0 : r.onAdded) == null || B.call(r));
|
|
345
345
|
}, [s, n, f, r, l, d, g]), R = o.length > 0, T = ce(() => l ? "title" in l ? l.title ?? "" : w(l, "") : "", [w, l]), D = V((B) => B.selectMax > 1 || B.selectMax === 0, []), H = V((B, J) => B.price > 0 ? ` (+${we(B.price, J, t)})` : "", [t]), le = { isOpen: r !== null, onClose: n, product: l, productName: T, hasModifiers: R, quantity: d, handleIncrement: k, handleDecrement: v, handleAddToCart: N, validationError: b, modifierGroups: o, isModifierSelected: p, isMultiSelect: D, toggleModifier: c, selectModifier: h, getModifierGroupName: y, formatModifierPrice: H, locale: t };
|
|
346
|
-
return e(
|
|
346
|
+
return e(an.Provider, { value: le, children: a });
|
|
347
347
|
}, wt = () => {
|
|
348
|
-
const a = ge(
|
|
348
|
+
const a = ge(an);
|
|
349
349
|
if (!a) throw new Error("useModifiers must be used within a ModifiersProvider");
|
|
350
350
|
return a;
|
|
351
351
|
}, Ul = ({ className: a, emptyCartComponent: t, renderItem: r, loadingComponent: n }) => {
|
|
352
|
-
const { organization: s } = Ne(), { locale: l, items: o, removeItem: d, updateItemQuantity: u, products: c, isProductsLoading: h } =
|
|
352
|
+
const { organization: s } = Ne(), { locale: l, items: o, removeItem: d, updateItemQuantity: u, products: c, isProductsLoading: h } = sr();
|
|
353
353
|
return !s || h ? n : o.length === 0 ? t : e("div", { className: a || "flex-1 overflow-y-auto", children: c && o.map((p) => {
|
|
354
354
|
const g = c[p.productId];
|
|
355
355
|
if (!g) return null;
|
|
356
|
-
const b = () => d(p.productId, p.modifierGroups), f = (y) => u(p.productId, y, p.modifierGroups), w =
|
|
356
|
+
const b = () => d(p.productId, p.modifierGroups), f = (y) => u(p.productId, y, p.modifierGroups), w = Xi(p, g, s.configuration.defaultCurrency, l);
|
|
357
357
|
return e(S.Fragment, { children: r({ ...w, remove: b, updateQuantity: f }) }, `${p.productId}-${JSON.stringify(p.modifierGroups)}`);
|
|
358
358
|
}) });
|
|
359
359
|
}, ql = ({ title: a, subtitle: t, image: r, price: n, quantity: s, remove: l, updateQuantity: o }) => {
|
|
@@ -373,17 +373,17 @@ const an = Ce(void 0), Ll = ({ children: a, initialOrganization: t, organization
|
|
|
373
373
|
}
|
|
374
374
|
o(h);
|
|
375
375
|
}, [d, s, l, o]);
|
|
376
|
-
return e("div", { className: x("p-1 mb-3 transition-shadow"), children: i("div", { className: "grid grid-cols-5", children: [e("div", { className: "shrink-0 w-full h-full mr-3 overflow-hidden col-span-2", children: r ? e(ve, { width: 100, height: 100, src: r.url, alt: a, className: "w-full h-
|
|
376
|
+
return e("div", { className: x("p-1 mb-3 transition-shadow"), children: i("div", { className: "grid grid-cols-5", children: [e("div", { className: "shrink-0 w-full h-full mr-3 overflow-hidden col-span-2", children: r ? e(ve, { width: 100, height: 100, src: r.url, alt: a, className: "w-full h-32 object-cover border rounded-md overflow-hidden" }) : e("div", { className: "bg-slate-100 h-full rounded-md flex items-center justify-center", children: e("span", { className: "text-slate-400", children: "No image" }) }) }), i("div", { className: "flex-1 min-w-0 pl-4 col-span-3", children: [i("div", { children: [e("h3", { className: "font-black text-slate-800 font-red-hat-display leading-tight", children: a }), t && e("p", { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: t }), e("p", { className: "text-xs font-medium text-gray-600 dark:text-gray-400 mt-1", children: n })] }), e("div", { className: "mt-3 flex items-center justify-between", children: i("div", { className: "inline-flex items-center overflow-hidden rounded-lg bg-white", children: [e("button", { type: "button", className: "storefront-primary-action flex h-8 w-8 cursor-pointer items-center justify-center text-sm font-semibold transition-colors", onClick: () => s <= 1 ? l() : o(Math.max(1, s - 1)), "aria-label": "Decrease quantity", children: "-" }), e("input", { type: "number", min: 1, step: 1, inputMode: "numeric", value: d, onChange: (h) => {
|
|
377
377
|
const p = h.target.value;
|
|
378
378
|
(p === "" || /^[0-9]+$/.test(p)) && u(p);
|
|
379
379
|
}, onBlur: c, onKeyDown: (h) => {
|
|
380
380
|
h.key === "Enter" && h.currentTarget.blur();
|
|
381
381
|
}, className: "h-8 w-11 border-x border-slate-200 bg-white px-0 text-center text-sm font-semibold text-slate-700 outline-none transition-colors focus:bg-slate-50 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", "aria-label": "Quantity" }), e("button", { type: "button", className: "storefront-primary-action flex h-8 w-8 cursor-pointer items-center justify-center text-sm font-semibold transition-colors", onClick: () => o(s + 1), "aria-label": "Increase quantity", children: "+" })] }) })] })] }) });
|
|
382
382
|
}, Wl = e("div", { className: "flex items-center justify-center h-32", children: i("svg", { "aria-hidden": "true", className: "storefront-primary-fill text-gray-200 animate-spin dark:text-gray-600 h-8 w-8", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }) }), _l = i("div", { className: "text-center py-4 text-sm text-slate-500 flex flex-col items-center", children: [e("div", { className: "bg-slate-100 p-2 rounded-full mb-2", children: e("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-8 w-8 text-slate-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z" }) }) }), e("p", { className: "font-medium", children: "Your cart is empty" })] }), $l = (a) => e(ql, { ...a }), Gl = ({ checkoutHref: a = "/checkout/customer-details", checkoutLabel: t = "Checkout", title: r = "Shopping bag", className: n = "bg-white shadow-xl rounded-lg overflow-hidden h-full flex flex-col", bodyClassName: s = "max-h-80 md:max-h-[550px] overflow-y-auto p-4 md:p-3 space-y-3 h-full", headerClassName: l = "storefront-primary-bg py-3 px-3 border-b border-slate-100 flex justify-between items-center", onClose: o, showCloseButton: d = !!o, emptyCartComponent: u = _l, loadingComponent: c = Wl, renderFooter: h, renderHeader: p, renderItem: g = $l }) => {
|
|
383
|
-
const { itemCount: b, total: f, locale: w } =
|
|
383
|
+
const { itemCount: b, total: f, locale: w } = sr(), { organization: y } = Ne(), k = (y == null ? void 0 : y.configuration.defaultCurrency) ?? "USD", v = we(f, k, w), N = { checkoutHref: a, checkoutLabel: t, close: o ?? (() => {
|
|
384
384
|
}), formattedTotal: v, itemCount: b, total: f };
|
|
385
385
|
return i("div", { className: n, children: [p ? p({ onClose: o, showCloseButton: d, title: r }) : i("div", { className: l, children: [e("h3", { className: "text-lg font-black font-red-hat-display text-white", children: r }), d && o && e("button", { onClick: o, className: "storefront-primary-bg-hover text-white p-1 rounded-full transition-colors", "aria-label": "Close cart", type: "button", children: e(Fi, { className: "h-5 w-5" }) })] }), e("div", { className: s, children: e(Ul, { renderItem: (R) => g(R), loadingComponent: c, emptyCartComponent: u }) }), b > 0 && (h ? h(N) : i("div", { className: "flex items-center px-4 py-4 border-t border-t-slate-200 mt-auto w-full", children: [e("div", { className: "w-[125px] font-medium h-[45px] rounded-lg flex items-center text-sm justify-center border border-slate-200 whitespace-nowrap mr-2", children: v }), e(E, { href: a, className: "storefront-primary-action btn text-sm rounded-lg w-full", onClick: o, children: t })] }))] });
|
|
386
|
-
},
|
|
386
|
+
}, ip = ({ isOpen: a, onClose: t, checkoutHref: r = "/checkout/customer-details", checkoutLabel: n = "Checkout", title: s = "Shopping bag", className: l, contentClassName: o, emptyCartComponent: d, loadingComponent: u, renderFooter: c, renderItem: h }) => {
|
|
387
387
|
const p = mi(null), [g, b] = F(null), [f, w] = F(null), y = 50, k = (R) => {
|
|
388
388
|
w(null), b(R.targetTouches[0].clientY);
|
|
389
389
|
}, v = (R) => {
|
|
@@ -408,7 +408,7 @@ const pa = (...a) => (t, r) => {
|
|
|
408
408
|
const d = n[l][o];
|
|
409
409
|
(typeof d != "string" || !d.trim()) && r.addIssue({ code: m.ZodIssueCode.custom, message: "This field is required", path: ["translations", l, o] });
|
|
410
410
|
});
|
|
411
|
-
}, vt = /* @__PURE__ */ new Map([["af", "Afrikaans"], ["sq", "Albanian"], ["ar_dz", "Arabic (Algeria)"], ["ar_bh", "Arabic (Bahrain)"], ["ar_eg", "Arabic (Egypt)"], ["ar_iq", "Arabic (Iraq)"], ["ar_jo", "Arabic (Jordan)"], ["ar_kw", "Arabic (Kuwait)"], ["ar_lb", "Arabic (Lebanon)"], ["ar_ly", "Arabic (Libya)"], ["ar_ma", "Arabic (Morocco)"], ["ar_om", "Arabic (Oman)"], ["ar_qa", "Arabic (Qatar)"], ["ar_sa", "Arabic (Saudi Arabia)"], ["ar_sy", "Arabic (Syria)"], ["ar_tn", "Arabic (Tunisia)"], ["ar_ae", "Arabic (U.A.E.)"], ["ar_ye", "Arabic (Yemen)"], ["eu", "Basque"], ["be", "Belarusian"], ["bg", "Bulgarian"], ["ca", "Catalan"], ["zh_hk", "Chinese (Hong Kong)"], ["zh_cn", "Chinese (PRC)"], ["zh_sg", "Chinese (Singapore)"], ["zh_tw", "Chinese (Taiwan)"], ["hr", "Croatian"], ["cs", "Czech"], ["da", "Danish"], ["nl_be", "Dutch (Belgium)"], ["nl", "Dutch (Standard)"], ["en", "English"], ["en_au", "English (Australia)"], ["en_bz", "English (Belize)"], ["en_ca", "English (Canada)"], ["en_ie", "English (Ireland)"], ["en_jm", "English (Jamaica)"], ["en_nz", "English (New Zealand)"], ["en_za", "English (South Africa)"], ["en_tt", "English (Trinidad)"], ["en_gb", "English (United Kingdom)"], ["en_us", "English (United States)"], ["et", "Estonian"], ["fo", "Faeroese"], ["fa", "Farsi"], ["fi", "Finnish"], ["fr_be", "French (Belgium)"], ["fr_ca", "French (Canada)"], ["fr_lu", "French (Luxembourg)"], ["fr", "French (Standard)"], ["fr_ch", "French (Switzerland)"], ["gd", "Gaelic (Scotland)"], ["de_at", "German (Austria)"], ["de_li", "German (Liechtenstein)"], ["de_lu", "German (Luxembourg)"], ["de", "German (Standard)"], ["de_ch", "German (Switzerland)"], ["el", "Greek"], ["he", "Hebrew"], ["hi", "Hindi"], ["hu", "Hungarian"], ["is", "Icelandic"], ["id", "Indonesian"], ["ga", "Irish"], ["it", "Italian (Standard)"], ["it_ch", "Italian (Switzerland)"], ["ja", "Japanese"], ["ko", "Korean"], ["ku", "Kurdish"], ["lv", "Latvian"], ["lt", "Lithuanian"], ["mk", "Macedonian (FYROM)"], ["ml", "Malayalam"], ["ms", "Malaysian"], ["mt", "Maltese"], ["no", "Norwegian"], ["nb", "Norwegian (Bokmål)"], ["nn", "Norwegian (Nynorsk)"], ["pl", "Polish"], ["pt_br", "Portuguese (Brazil)"], ["pt", "Portuguese (Portugal)"], ["pa", "Punjabi"], ["rm", "Rhaeto-Romanic"], ["ro", "Romanian"], ["ro_md", "Romanian (Republic of Moldova)"], ["ru", "Russian"], ["ru_md", "Russian (Republic of Moldova)"], ["sr", "Serbian"], ["sk", "Slovak"], ["sl", "Slovenian"], ["sb", "Sorbian"], ["es_ar", "Spanish (Argentina)"], ["es_bo", "Spanish (Bolivia)"], ["es_cl", "Spanish (Chile)"], ["es_co", "Spanish (Colombia)"], ["es_cr", "Spanish (Costa Rica)"], ["es_do", "Spanish (Dominican Republic)"], ["es_ec", "Spanish (Ecuador)"], ["es_sv", "Spanish (El Salvador)"], ["es_gt", "Spanish (Guatemala)"], ["es_hn", "Spanish (Honduras)"], ["es_mx", "Spanish (Mexico)"], ["es", "Spanish (Spain)"], ["sv", "Swedish"], ["sv_fi", "Swedish (Finland)"], ["th", "Thai"], ["tr", "Turkish"], ["uk", "Ukrainian"], ["ur", "Urdu"], ["vi", "Vietnamese"], ["cy", "Welsh"], ["ji", "Yiddish"], ["zu", "Zulu"]]),
|
|
411
|
+
}, vt = /* @__PURE__ */ new Map([["af", "Afrikaans"], ["sq", "Albanian"], ["ar_dz", "Arabic (Algeria)"], ["ar_bh", "Arabic (Bahrain)"], ["ar_eg", "Arabic (Egypt)"], ["ar_iq", "Arabic (Iraq)"], ["ar_jo", "Arabic (Jordan)"], ["ar_kw", "Arabic (Kuwait)"], ["ar_lb", "Arabic (Lebanon)"], ["ar_ly", "Arabic (Libya)"], ["ar_ma", "Arabic (Morocco)"], ["ar_om", "Arabic (Oman)"], ["ar_qa", "Arabic (Qatar)"], ["ar_sa", "Arabic (Saudi Arabia)"], ["ar_sy", "Arabic (Syria)"], ["ar_tn", "Arabic (Tunisia)"], ["ar_ae", "Arabic (U.A.E.)"], ["ar_ye", "Arabic (Yemen)"], ["eu", "Basque"], ["be", "Belarusian"], ["bg", "Bulgarian"], ["ca", "Catalan"], ["zh_hk", "Chinese (Hong Kong)"], ["zh_cn", "Chinese (PRC)"], ["zh_sg", "Chinese (Singapore)"], ["zh_tw", "Chinese (Taiwan)"], ["hr", "Croatian"], ["cs", "Czech"], ["da", "Danish"], ["nl_be", "Dutch (Belgium)"], ["nl", "Dutch (Standard)"], ["en", "English"], ["en_au", "English (Australia)"], ["en_bz", "English (Belize)"], ["en_ca", "English (Canada)"], ["en_ie", "English (Ireland)"], ["en_jm", "English (Jamaica)"], ["en_nz", "English (New Zealand)"], ["en_za", "English (South Africa)"], ["en_tt", "English (Trinidad)"], ["en_gb", "English (United Kingdom)"], ["en_us", "English (United States)"], ["et", "Estonian"], ["fo", "Faeroese"], ["fa", "Farsi"], ["fi", "Finnish"], ["fr_be", "French (Belgium)"], ["fr_ca", "French (Canada)"], ["fr_lu", "French (Luxembourg)"], ["fr", "French (Standard)"], ["fr_ch", "French (Switzerland)"], ["gd", "Gaelic (Scotland)"], ["de_at", "German (Austria)"], ["de_li", "German (Liechtenstein)"], ["de_lu", "German (Luxembourg)"], ["de", "German (Standard)"], ["de_ch", "German (Switzerland)"], ["el", "Greek"], ["he", "Hebrew"], ["hi", "Hindi"], ["hu", "Hungarian"], ["is", "Icelandic"], ["id", "Indonesian"], ["ga", "Irish"], ["it", "Italian (Standard)"], ["it_ch", "Italian (Switzerland)"], ["ja", "Japanese"], ["ko", "Korean"], ["ku", "Kurdish"], ["lv", "Latvian"], ["lt", "Lithuanian"], ["mk", "Macedonian (FYROM)"], ["ml", "Malayalam"], ["ms", "Malaysian"], ["mt", "Maltese"], ["no", "Norwegian"], ["nb", "Norwegian (Bokmål)"], ["nn", "Norwegian (Nynorsk)"], ["pl", "Polish"], ["pt_br", "Portuguese (Brazil)"], ["pt", "Portuguese (Portugal)"], ["pa", "Punjabi"], ["rm", "Rhaeto-Romanic"], ["ro", "Romanian"], ["ro_md", "Romanian (Republic of Moldova)"], ["ru", "Russian"], ["ru_md", "Russian (Republic of Moldova)"], ["sr", "Serbian"], ["sk", "Slovak"], ["sl", "Slovenian"], ["sb", "Sorbian"], ["es_ar", "Spanish (Argentina)"], ["es_bo", "Spanish (Bolivia)"], ["es_cl", "Spanish (Chile)"], ["es_co", "Spanish (Colombia)"], ["es_cr", "Spanish (Costa Rica)"], ["es_do", "Spanish (Dominican Republic)"], ["es_ec", "Spanish (Ecuador)"], ["es_sv", "Spanish (El Salvador)"], ["es_gt", "Spanish (Guatemala)"], ["es_hn", "Spanish (Honduras)"], ["es_mx", "Spanish (Mexico)"], ["es", "Spanish (Spain)"], ["sv", "Swedish"], ["sv_fi", "Swedish (Finland)"], ["th", "Thai"], ["tr", "Turkish"], ["uk", "Ukrainian"], ["ur", "Urdu"], ["vi", "Vietnamese"], ["cy", "Welsh"], ["ji", "Yiddish"], ["zu", "Zulu"]]), Hr = Array.from(vt.entries()).map(([a, t]) => ({ value: a, label: t })), Je = m.enum(["af", "sq", "ar_dz", "ar_bh", "ar_eg", "ar_iq", "ar_jo", "ar_kw", "ar_lb", "ar_ly", "ar_ma", "ar_om", "ar_qa", "ar_sa", "ar_sy", "ar_tn", "ar_ae", "ar_ye", "eu", "be", "bg", "ca", "zh_hk", "zh_cn", "zh_sg", "zh_tw", "hr", "cs", "da", "nl_be", "nl", "en", "en_au", "en_bz", "en_ca", "en_ie", "en_jm", "en_nz", "en_za", "en_tt", "en_gb", "en_us", "et", "fo", "fa", "fi", "fr_be", "fr_ca", "fr_lu", "fr", "fr_ch", "gd", "de_at", "de_li", "de_lu", "de", "de_ch", "el", "he", "hi", "hu", "is", "id", "ga", "it", "it_ch", "ja", "ko", "ku", "lv", "lt", "mk", "ml", "ms", "mt", "no", "nb", "nn", "pl", "pt_br", "pt", "pa", "rm", "ro", "ro_md", "ru", "ru_md", "sr", "sk", "sl", "sb", "es_ar", "es_bo", "es_cl", "es_co", "es_cr", "es_do", "es_ec", "es_sv", "es_gt", "es_hn", "es_mx", "es", "sv", "sv_fi", "th", "tr", "uk", "ur", "vi", "cy", "ji", "zu"]).openapi({ description: "Enum for locale values", example: "en" }), rn = m.union([m.string(), m.number(), m.null()]).optional().transform((a) => {
|
|
412
412
|
if (a == null || a === "") return null;
|
|
413
413
|
if (typeof a == "number") return a;
|
|
414
414
|
const t = Number(a);
|
|
@@ -417,71 +417,71 @@ const pa = (...a) => (t, r) => {
|
|
|
417
417
|
m.discriminatedUnion("type", [lo, oo]), m.discriminatedUnion("type", [m.object({ type: m.literal("blob.generate-client-token"), clientToken: m.string() }), m.object({ type: m.literal("blob.upload-completed"), response: m.literal("ok") })]), m.object({ mimeType: m.string().min(1, "MIME type is required").openapi({ example: "image/png", description: "MIME type of the file" }), size: m.number().min(1, "Size is required").openapi({ example: 1024, description: "Size of the file in bytes" }), filename: m.string().min(1, "Filename is required").openapi({ example: "example.png", description: "Name of the file" }), organizationId: m.string().optional().openapi({ example: "clm1234567890abcdef", description: "ID of the organization" }) });
|
|
418
418
|
const _e = m.object({ id: m.string().min(1, "ID is required").openapi({ example: "clf9876543210abcdef", description: "ID of the file" }), url: m.string().min(1, "Path is required").openapi({ example: "/path/to/file", description: "Path of the file" }), mimeType: m.string().min(1, "MIME type is required").openapi({ example: "image/png", description: "MIME type of the file" }), size: m.number().min(1, "Size is required").openapi({ example: 1024, description: "Size of the file in bytes" }), filename: m.string().min(1, "Filename is required").openapi({ example: "example.png", description: "Name of the file" }) }).openapi("UploadedFile"), Nt = m.object({ id: m.string().openapi({ example: "clf9876543210abcdef", description: "ID of the product category" }), slug: m.string().openapi({ example: "electronics", description: "Slug of the product category" }), image: _e.nullable().optional().openapi({ description: "Image of the product category" }), createdAt: m.date(), publishedAt: m.date().nullable().optional().openapi({ description: "Timestamp when the product category was published" }), translations: m.array(m.object({ locale: m.string().min(1, "Locale is required").openapi({ example: "en-US", description: "Locale code for the translation" }), title: m.string().default("").openapi({ example: "Electronics", description: "Name of the product category in the specified locale" }), description: m.string().max(6e3, "Maximum character limit is 6000").nullable().default("").optional().openapi({ example: "A category for electronic devices.", description: "Description of the product category in the specified locale" }) })).openapi({ description: "List of translations for the product category" }) }).openapi("ProductCategory");
|
|
419
419
|
Nt.omit({ translations: !0 }).extend({ title: m.string().default(""), description: m.string().default("") }).openapi("LocalizedProductCategory");
|
|
420
|
-
const co = Nt.pick({ slug: !0, image: !0, translations: !0 }).extend({ defaultLocale: m.string().min(1, "Default locale is required").openapi({ description: "The default locale for the product category" }), imageId: m.string().cuid().optional().openapi({ description: "ID of the image for the product category" }) }).superRefine(pa("title")).openapi("CreateProductCategory"), mo = Nt.pick({ slug: !0, image: !0, translations: !0 }).extend({ defaultLocale: m.string().min(1, "Default locale is required").openapi({ description: "The default locale for the product category" }), imageId: m.string().cuid().optional().nullable().openapi({ description: "ID of the image for the product category" }) }).partial().superRefine(pa("title")).openapi("UpdateProductCategory"),
|
|
420
|
+
const co = Nt.pick({ slug: !0, image: !0, translations: !0 }).extend({ defaultLocale: m.string().min(1, "Default locale is required").openapi({ description: "The default locale for the product category" }), imageId: m.string().cuid().optional().openapi({ description: "ID of the image for the product category" }) }).superRefine(pa("title")).openapi("CreateProductCategory"), mo = Nt.pick({ slug: !0, image: !0, translations: !0 }).extend({ defaultLocale: m.string().min(1, "Default locale is required").openapi({ description: "The default locale for the product category" }), imageId: m.string().cuid().optional().nullable().openapi({ description: "ID of the image for the product category" }) }).partial().superRefine(pa("title")).openapi("UpdateProductCategory"), nn = m.object({ id: m.string().cuid().optional(), title: m.string().min(1, "This field is required").openapi({ example: "Large", description: "Title of the modifier" }), sku: m.coerce.string().optional().openapi({ example: "csd9876543210abcdef", description: "Stock Keeping Unit identifier" }), price: m.coerce.number().optional().default(0).openapi({ example: 2.5, description: "Price of the modifier" }) }).openapi("Modifier"), sn = m.object({ id: m.string().cuid(), selectMin: m.coerce.number().min(0).openapi({ example: 1, description: "Minimum number of modifiers that can be selected" }), selectMax: m.coerce.number().min(0).openapi({ example: 1, description: "Maximum number of modifiers that can be selected" }), defaultLocale: Je.optional(), modifiers: m.array(nn).optional().openapi({}), translations: m.array(m.object({ locale: Je, title: m.string().optional().openapi({ example: "Size", description: "Title of the modifier group" }) })) }).openapi("ModifierGroup"), uo = sn.extend({ title: m.string().default("").nullable() }).omit({ translations: !0 }).openapi("LocalizedModifierGroup"), ln = m.object({ selectMin: m.coerce.number().min(0).openapi({ example: 1, description: "Minimum number of modifiers that can be selected" }), selectMax: m.coerce.number().min(0).openapi({ example: 1, description: "Maximum number of modifiers that can be selected" }), defaultLocale: Je.optional(), modifiers: m.array(nn).optional().openapi({}), translations: m.array(m.object({ locale: Je, title: m.string().optional().openapi({ example: "Size", description: "Title of the modifier group" }) })) }).refine((a) => a.selectMax >= a.selectMin, { message: "Maximum selections must be greater than or equal to minimum selections", path: ["selectMax"] }).refine((a) => {
|
|
421
421
|
var r;
|
|
422
422
|
const t = ((r = a.modifiers) == null ? void 0 : r.length) || 0;
|
|
423
423
|
return a.selectMax <= t;
|
|
424
|
-
}, { message: "Maximum selections cannot exceed the total number of modifiers", path: ["selectMax"] }).superRefine(pa("title")).openapi("CreateOrUpdateModifierGroup"),
|
|
424
|
+
}, { message: "Maximum selections cannot exceed the total number of modifiers", path: ["selectMax"] }).superRefine(pa("title")).openapi("CreateOrUpdateModifierGroup"), on = m.object({ id: m.string().cuid().openapi({ example: "clf9876543210abcdef", description: "ID of the product" }), slug: m.string().optional().openapi({ example: "premium-watch", description: "Unique slug for the product" }), sku: m.string().optional().openapi({ example: "PRM-WATCH-01", description: "Stock Keeping Unit identifier" }), basePrice: tt, discountedBasePrice: rn, currency: m.string().openapi({ example: "USD", description: "Currency code for pricing" }), images: m.array(_e).optional().openapi({ description: "List of product images" }), modifierGroups: m.array(sn).optional().openapi({ description: "List of product modifier groups" }), categories: m.array(Nt).openapi({ example: ["cju0z9k4z0000l1qg5z1z1z"], description: "IDs of associated product categories" }), manufacturerId: m.string().cuid().nullable().optional().openapi({ description: "ID of associated manufacturer" }), createdAt: m.date(), publishedAt: m.date().nullable().optional(), translations: m.array(m.object({ locale: Je, title: m.coerce.string().optional().openapi({ example: "Premium Watch", description: "Product name in specified locale" }), description: m.string().nullable().optional().openapi({ example: "High-quality premium watch", description: "Product description in specified locale" }) })).optional(), metadata: m.record(m.string().min(1, "Key cannot be empty").max(50, "Key too long").regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/, "Key must start with letter and contain only letters, numbers, underscore, or dash"), m.string().min(1, "Value cannot be empty").max(200, "Value too long")).optional().nullable() }).openapi("Product"), po = on.extend({ title: m.string().default(""), description: m.string().nullable().default(""), modifierGroups: m.array(uo), categories: m.array(m.object({ id: m.string().cuid().openapi({ example: "cju0z9k4z0000l1qg5z1z1z", description: "ID of the product category" }) })).default([]) }).omit({ translations: !0 }).openapi("LocalizedProduct"), dn = on.pick({ slug: !0, sku: !0, basePrice: !0, discountedBasePrice: !0, currency: !0, images: !0, manufacturerId: !0, translations: !0, metadata: !0 }).extend({ defaultLocale: m.string().min(1, "Default locale is required").openapi({ example: "en-US", description: "Default translation locale" }), modifierGroups: m.array(ln).optional().openapi({ description: "List of product modifier groups" }), categories: m.array(m.string()).optional().openapi({ example: ["cju0z9k4z0000l1qg5z1z1z"], description: "IDs of associated product categories" }) }), ho = dn.superRefine((a, t) => (a.discountedBasePrice !== null && a.discountedBasePrice !== void 0 && a.discountedBasePrice > a.basePrice && t.addIssue({ code: m.ZodIssueCode.custom, path: ["discountedBasePrice"], message: "Discounted price cannot exceed base price" }), pa("title")(a, t))).openapi("CreateProduct"), go = dn.partial().superRefine((a, t) => (a.discountedBasePrice !== null && a.discountedBasePrice !== void 0 && a.basePrice && a.discountedBasePrice > a.basePrice && t.addIssue({ code: m.ZodIssueCode.custom, path: ["discountedBasePrice"], message: "Discounted price cannot exceed base price" }), pa("title")(a, t))).openapi("UpdateProduct");
|
|
425
425
|
m.record(m.string().openapi({ example: "clf9876543210abcdef", description: "ID of the product in the cart" }), po);
|
|
426
|
-
const
|
|
426
|
+
const cn = m.object({ productId: m.string().cuid().openapi({ example: "clf9876543210abcdef", description: "ID of the product in the cart" }), quantity: m.number().default(1).optional().openapi({ example: 2, description: "Quantity of this item in the cart" }), modifierGroups: m.array(m.object({ id: m.string().cuid().openapi({ example: "clg1234567890abcdef", description: "ID of the modifier group" }), modifiers: m.array(m.object({ id: m.string().cuid().openapi({ example: "clh9876543210abcdef", description: "ID of the selected modifier" }), quantity: m.number().default(1).openapi({ example: 1, description: "Quantity of this modifier" }) })) })) }).openapi("CartItem"), fo = m.object({ items: m.array(cn), shippingMethodId: m.string().cuid().optional() });
|
|
427
427
|
m.object({ status: m.number().openapi({ example: 404, description: "The HTTP status code" }), message: m.string().openapi({ example: "Not found", description: "The error message" }) }), m.object({ "accept-language": m.string().optional().openapi({ example: "en-US", description: "Accept-Language header", param: { in: "header", name: "accept-language" } }), cookie: m.string().optional().openapi({ example: "session=1234567890", description: "Cookie header", param: { in: "header", name: "cookie" } }) }).openapi("Headers"), m.object({ id: m.string().openapi({ example: "clm1234567890abcdef", description: "User's ID" }), email: m.string().openapi({ example: "user@example.com", description: "User's email address", format: "email" }), firstname: m.string().openapi({ example: "John", description: "User's first name" }), lastname: m.string().openapi({ example: "Doe", description: "User's last name" }), image: m.string().nullable().optional().openapi({ example: "https://example.com/image.jpg", description: "User's profile image" }), name: m.string().nullable().optional().openapi({ description: "User's full name (optional)" }) }).openapi("User"), m.object({ page: m.coerce.number().optional().default(1).openapi({ example: 1, description: "Page number" }), limit: m.coerce.number().optional().default(10).openapi({ example: 50, description: "Number of items per page" }), search: m.string().optional().openapi({ example: "Apple", description: "Search query" }), published: m.coerce.boolean().optional().openapi({ example: !0, description: "Whether to filter by published items" }), locale: Je.optional() }), m.object({ isFirstPage: m.boolean().openapi({ example: !0, description: "Whether the current page is the first page" }), isLastPage: m.boolean().openapi({ example: !1, description: "Whether the current page is the last page" }), currentPage: m.number().openapi({ example: 1, description: "The current page number" }), previousPage: m.number().nullable().openapi({ example: 0, description: "The previous page number" }), nextPage: m.number().nullable().openapi({ example: 2, description: "The next page number" }), pageCount: m.number().openapi({ example: 5, description: "The total number of pages" }), totalCount: m.number().openapi({ example: 50, description: "The total number of items" }) }).openapi("PaginationMeta");
|
|
428
|
-
const ha = m.object({ id: m.string().cuid().openapi({ example: "clf9876543210abcdef", description: "The unique identifier of the address" }), firstname: m.string().optional().nullable().openapi({ example: "John", description: "The first name of the recipient" }), lastname: m.string().optional().nullable().openapi({ example: "Doe", description: "The last name of the recipient" }), phone: m.string().optional().nullable().openapi({ example: "+1234567890", description: "Phone number of the recipient" }), addressLineOne: m.string().openapi({ example: "123 Main Street", description: "The first line of the address" }), doorNumber: m.string().nullable().optional().openapi({ description: "The door number of the address" }), addressLineTwo: m.string().nullable().optional().openapi({ example: "Suite 100", description: "The second line of the address" }), zipCode: m.string().optional().openapi({ example: "12345", description: "The postal code of the address" }), city: m.string().openapi({ example: "New York", description: "The city of the address" }), country: m.string().openapi({ example: "USA", description: "The country of the address" }), placeId: m.string().openapi({ example: "ChIJN1t_tKlj4AR4GeTYWZ7frY", description: "The Google Place ID for the address" }), deliveryInstructions: m.string().nullable().optional().openapi({ example: "Leave at the door", description: "Delivery instructions for the address" }) }).openapi("Address"), At = ha.pick({ addressLineOne: !0, doorNumber: !0, addressLineTwo: !0, zipCode: !0, city: !0, country: !0, placeId: !0 }).openapi("CreateAddress"),
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
m.object({ id: m.string().min(1), provider:
|
|
432
|
-
const xo = m.object({ id: m.string().cuid().min(1), method:
|
|
433
|
-
m.object({ id: m.string().openapi({ description: "Unique identifier for the order", example: "clj1234567890abcdef" }), referenceId: m.string().openapi({ description: "External reference ID for the order", example: "ORD-12345" }), status: ko.optional(), token: m.string().openapi({ description: "Security token for order verification", example: "a1b2c3d4e5f6g7h8i9j0" }), expiresAt: m.date().openapi({ description: "Expiration date for the order", example: "2023-12-31T23:59:59Z" }), items: m.array(vo).min(1).openapi({ description: "Array of items in the order" }), shippingMethod:
|
|
428
|
+
const ha = m.object({ id: m.string().cuid().openapi({ example: "clf9876543210abcdef", description: "The unique identifier of the address" }), firstname: m.string().optional().nullable().openapi({ example: "John", description: "The first name of the recipient" }), lastname: m.string().optional().nullable().openapi({ example: "Doe", description: "The last name of the recipient" }), phone: m.string().optional().nullable().openapi({ example: "+1234567890", description: "Phone number of the recipient" }), addressLineOne: m.string().openapi({ example: "123 Main Street", description: "The first line of the address" }), doorNumber: m.string().nullable().optional().openapi({ description: "The door number of the address" }), addressLineTwo: m.string().nullable().optional().openapi({ example: "Suite 100", description: "The second line of the address" }), zipCode: m.string().optional().openapi({ example: "12345", description: "The postal code of the address" }), city: m.string().openapi({ example: "New York", description: "The city of the address" }), country: m.string().openapi({ example: "USA", description: "The country of the address" }), placeId: m.string().openapi({ example: "ChIJN1t_tKlj4AR4GeTYWZ7frY", description: "The Google Place ID for the address" }), deliveryInstructions: m.string().nullable().optional().openapi({ example: "Leave at the door", description: "Delivery instructions for the address" }) }).openapi("Address"), At = ha.pick({ addressLineOne: !0, doorNumber: !0, addressLineTwo: !0, zipCode: !0, city: !0, country: !0, placeId: !0 }).openapi("CreateAddress"), mn = At.partial().openapi("UpdateAddress"), yo = ha.extend({ firstname: m.string().min(2, "First Name must be at least 2 characters").openapi({ example: "John", description: "The first name of the recipient" }), lastname: m.string().min(1, "Last Name must be at least 2 characters").openapi({ example: "Doe", description: "The last name of the recipient" }), phone: m.string().min(4).openapi({ example: "+1234567890", description: "Phone number of the recepient" }) }), un = yo.pick({ firstname: !0, lastname: !0, phone: !0, addressLineOne: !0, addressLineTwo: !0, doorNumber: !0, zipCode: !0, city: !0, country: !0, placeId: !0, deliveryInstructions: !0 });
|
|
429
|
+
un.partial().extend({ placeId: m.string().min(1, "This field is required").openapi({ example: "ChIJN1t_tKlj4AR4GeTYWZ7frY", description: "The Google Place ID for the address" }) }).openapi("UpdateShippingAddress");
|
|
430
|
+
const lr = m.enum(["card", "blik", "cash_on_delivery", "paypal"]).openapi({ description: "The payment method", example: "card" }), or = m.enum(["stripe", "revolut", "payu", "not_applicable"]).openapi({ description: "The payment method", example: "card" }), bo = m.enum(["pending", "succeeded", "refunded", "failed", "canceled"]).openapi({ description: "The payment status", example: "pending" });
|
|
431
|
+
m.object({ id: m.string().min(1), provider: or, method: lr, description: m.string().min(1) }).openapi({ description: "The payment method", example: { provider: "stripe", type: "card" } });
|
|
432
|
+
const xo = m.object({ id: m.string().cuid().min(1), method: lr, provider: or, status: bo, shipping: m.number().min(0).default(0), subtotal: m.number().min(0), total: m.number().min(0), discount: m.number().min(0).default(0), currency: kt }), Ur = m.object({ id: m.string().optional().openapi({ example: "clf9876543210abcdef", description: "ID of the shipping zone" }), title: m.string().min(1, "Title is required").openapi({ example: "Zone 1", description: "Title of the shipping zone" }), distanceUpto: tt.openapi({ example: 10, description: "Ending distance for the shipping zone" }), price: tt.openapi({ example: 5.99, description: "Price for shipping in this zone" }), minimumOrderAmount: rn.openapi({ example: 50, description: "Minimum order amount for this shipping zone" }), eta: m.string().min(1, "ETA is required").openapi({ example: "2-3 days", description: "Estimated time of arrival for this shipping zone" }) }).openapi("ShippingZone"), pn = m.object({ id: m.string().openapi({ example: "clf9876543210abcdef", description: "ID of the shipping method" }), title: m.string().min(1, "Title is required").openapi({ example: "Standard Shipping", description: "Title of the shipping method" }), providerName: m.string().min(1, "Provider name is required").openapi({ example: "FedEx", description: "Name of the shipping provider" }), providerLogo: _e.nullable().optional().openapi({ description: "Logo of the shipping provider" }), requireDateOfDelivery: m.coerce.boolean().optional().openapi({ example: !0, description: "Whether the delivery time should be selected" }), shippingZones: m.array(Ur).openapi({ description: "List of shipping zones for this shipping method" }), eligibleShippingZone: Ur.optional(), createdAt: m.date(), updatedAt: m.date() }).openapi("ShippingMethod"), hn = pn.pick({ title: !0, providerName: !0, providerLogo: !0, requireDateOfDelivery: !0, shippingZones: !0 }).extend({ providerLogoId: m.string().cuid().optional().openapi({ example: "clf9876543210abcdef", description: "ID reference to the provider logo file" }) }).openapi("CreateShippingMethod"), wo = hn.partial().openapi("UpdateShippingMethod"), ko = m.enum(["draft", "pending", "accepted", "ready-for-dispatch", "dispatched", "completed", "cancelled"]).openapi({ description: "Status of the order", example: "accepted" }), vo = m.object({ translations: m.array(m.object({ locale: Je.openapi({ description: "Locale of the translation", example: "en-US" }), title: m.string().openapi({ description: "Title of the ordered product", example: "Premium Watch" }), subtitle: m.string().openapi({ description: "Additional details about the ordered item, including modifiers", example: "Color: Silver, Size: Large" }) })).openapi({ description: "Translations for the order item" }), rawData: cn, unitPrice: m.number().min(0).openapi({ description: "Price per unit of the item", example: 299.99 }), image: _e.nullable().optional(), totalPrice: m.number().min(0).openapi({ description: "Total price for this item (unitPrice × quantity)", example: 599.98 }), quantity: m.number().min(1).openapi({ description: "Number of units ordered", example: 2 }), productSnapshotId: m.string().cuid() }).openapi("OrderItem");
|
|
433
|
+
m.object({ id: m.string().openapi({ description: "Unique identifier for the order", example: "clj1234567890abcdef" }), referenceId: m.string().openapi({ description: "External reference ID for the order", example: "ORD-12345" }), status: ko.optional(), token: m.string().openapi({ description: "Security token for order verification", example: "a1b2c3d4e5f6g7h8i9j0" }), expiresAt: m.date().openapi({ description: "Expiration date for the order", example: "2023-12-31T23:59:59Z" }), items: m.array(vo).min(1).openapi({ description: "Array of items in the order" }), shippingMethod: pn.nullable().openapi({ description: "Shipping method selected for the order" }), acceptedAt: m.date().nullable().optional().openapi({ description: "Date when the order was accepted", example: "2023-06-15T14:30:00Z" }), dispatchedAt: m.date().nullable().optional().openapi({ description: "Date when the order was dispatched", example: "2023-06-16T09:15:00Z" }), readyForDispatchAt: m.date().nullable().optional().openapi({ description: "Date when the order was ready for dispatch", example: "2023-06-16T09:15:00Z" }), createdAt: m.date().openapi({ description: "Date when the order was created", example: "2023-06-15T14:30:00Z" }), completedAt: m.date().nullable().optional().openapi({ description: "Date when the order was completed", example: "2023-06-18T11:45:00Z" }), cancelledAt: m.date().nullable().optional().openapi({ description: "Date when the order was cancelled", example: "2023-06-14T16:20:00Z" }), shippingAddress: ha.nullable().optional(), fulfilmentMethod: Ht.openapi({ description: "Method of order fulfilment (pickup or delivery)", example: "delivery" }), currency: kt.openapi({ description: "Currency used for the order", example: "USD" }), payment: xo }).transform((a) => {
|
|
434
434
|
let t;
|
|
435
435
|
return a.cancelledAt ? t = "cancelled" : a.completedAt ? t = "completed" : a.dispatchedAt ? t = "dispatched" : a.readyForDispatchAt ? t = "ready-for-dispatch" : a.acceptedAt ? t = "accepted" : t = "pending", { ...a, status: t };
|
|
436
|
-
}).openapi("Order"), fo.extend({ fulfilmentMethod: Ht.default("delivery"), payment: m.object({ provider:
|
|
437
|
-
const
|
|
436
|
+
}).openapi("Order"), fo.extend({ fulfilmentMethod: Ht.default("delivery"), payment: m.object({ provider: or, method: lr }), checkoutBaseUrl: m.string().url() }).refine((a) => a.fulfilmentMethod !== "delivery" || a.shippingMethodId !== void 0, { message: "shippingMethodId is required when fulfilmentMethod is 'delivery'", path: ["shippingMethodId"] }).openapi("CreateOrder");
|
|
437
|
+
const qr = m.object({ monday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Monday" }), tuesday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Tuesday" }), wednesday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Wednesday" }), thursday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Thursday" }), friday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Friday" }), saturday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Saturday" }), sunday: m.string().nullable().openapi({ example: "09:00", description: "Opening time for Sunday" }) }).openapi("TimeSchedule"), gn = m.object({ id: m.string().openapi({ example: "clm1234567890abcdef", description: "Unique identifier for the organization configuration" }), hostname: m.coerce.string().optional().openapi({ example: "store.example.com", description: "Hostname associated with the organization" }), countriesShipping: m.array(m.string()).openapi({ example: ["US", "CA"], description: "List of countries where shipping is available" }), stripeAccountId: m.coerce.string().optional().openapi({ example: "acct_123456789", description: "Stripe account ID associated with the organization" }), enableHostCheckout: m.boolean().openapi({ example: !0, description: "Indicates if host checkout is enabled" }), enableHostTracking: m.boolean().openapi({ example: !0, description: "Indicates if host tracking is enabled" }), isAcceptingOrders: m.boolean().openapi({ example: !0, description: "Indicates if the organization is currently accepting orders" }), isOpen: m.boolean().default(!1).openapi({ example: !0, description: "Indicates if the organization is currently open" }), defaultLocale: Je, supportedLocales: m.array(Je).openapi({ description: "List of supported locales for the organization" }), openingTimes: qr.optional(), closingTimes: qr.optional(), facebookProfile: m.string().nullable().optional().openapi({ example: "https://www.facebook.com/example", description: "Facebook profile URL for the organization" }), instagramProfile: m.string().nullable().optional().openapi({ example: "https://www.instagram.com/example", description: "Instagram profile URL for the organization" }), xProfile: m.string().nullable().optional().openapi({ example: "https://www.x.com/example", description: "X profile URL for the organization" }), defaultCurrency: kt.openapi({ example: "USD", description: "Default currency for the organization" }), createdAt: m.date().openapi({ description: "Timestamp when the organization configuration was created" }) }).openapi("OrganizationConfiguration"), No = gn.pick({ hostname: !0, countriesShipping: !0, stripeAccountId: !0, enableHostCheckout: !0, enableHostTracking: !0, isAcceptingOrders: !0, defaultLocale: !0, supportedLocales: !0, defaultCurrency: !0, openingTimes: !0, closingTimes: !0, facebookProfile: !0, instagramProfile: !0, xProfile: !0 }).partial().openapi("UpdateOrganizationConfiguration"), Ao = m.object({ id: m.string().openapi({ example: "clm1234567890abcdef", description: "The unique identifier of the organization" }), name: m.string().openapi({ example: "Acme Store", description: "The name of the organization" }), phone: m.string().min(1, "Phone number is required").openapi({ example: "+48123456890", description: "The phone number of the organization" }), email: m.string().email().optional().openapi({ example: "john.doe@example.com", description: "The email address of the organization" }), createdAt: m.date().openapi({ example: "2022-01-01T00:00:00.000Z", description: "The date and time the organization was created" }), legalEntityId: m.string().nullable().openapi({ example: "clm1234567890abcdef", description: "The unique identifier of the legal entity associated with the organization" }), address: ha, configuration: gn.openapi({ description: "The configuration settings for the organization" }), logo: m.string().url().optional().nullable().openapi({ example: "https://example.com/logo.jpg", description: "The logo of the organization" }), logoFile: _e.optional().nullable().openapi({ description: "The logo of the organization" }) }).openapi("Organization"), fn = Ao.pick({ name: !0, phone: !0, email: !0, logoFile: !0 }).extend({ logoId: m.string().optional().nullable().openapi({ example: "clm1234567890abcdef", description: "The unique identifier of the thumbnail image associated with the organization" }), address: At }).openapi("CreateOrganization"), dr = fn.extend({ address: mn, configuration: No }).partial().openapi("UpdateOrganization"), Co = m.object({ id: m.string().openapi({ example: "clf9876543210abcdef", description: "ID of the manufacturer" }), name: m.string().openapi({ example: "Tech Innovators Inc.", description: "Name of the manufacturer" }), logo: _e.nullable().optional().openapi({ description: "Logo of the manufacturer" }), createdAt: m.date(), translations: m.array(m.object({ locale: m.string().min(1, "Locale is required").openapi({ example: "en-US", description: "Locale code for the translation" }), about: m.string().max(6e3, "Maximum character limit is 6000").nullable().optional().openapi({ example: "Tech Innovators Inc. is a technology company.", description: "Description about the manufacturer in the specified locale" }) })).optional().openapi({ description: "List of translations for the manufacturer" }) }).openapi("Manufacturer");
|
|
438
438
|
Co.omit({ translations: !0 }).extend({ about: m.string().nullable().optional().default("") }).openapi("LocalizedManufacturer");
|
|
439
439
|
const So = m.object({ name: m.string().min(1, "Name is required").openapi({ example: "Apple Inc.", description: "Name of the manufacturer" }), defaultLocale: m.string().min(1, "Default locale is required").openapi({ example: "en-US", description: "The default locale for the manufacturer" }), logo: _e.nullable().optional().openapi({ description: "Logo of the manufacturer" }), translations: m.array(m.object({ locale: m.string().min(1, "Locale is required").openapi({ example: "en-US", description: "Locale code for the translation" }), about: m.string().max(6e3, "Maximum character limit is 6000").nullable().optional().openapi({ example: "Apple Inc. is a multinational technology company.", description: "Description about the manufacturer in the specified locale" }) })).min(1, "Translations are required").openapi({ description: "List of translations for the manufacturer" }), logoId: m.string().optional().openapi({ example: "clf9876543210abcdef", description: "ID reference to the manufacturer's logo file" }) }).superRefine(pa("about")).openapi("CreateManufacturer"), Io = m.object({ name: m.string().min(1, "Name is required").optional().openapi({ example: "Apple Inc. Updated", description: "Name of the manufacturer" }), logo: _e.nullable().optional().openapi({ description: "Logo of the manufacturer" }), defaultLocale: m.string().min(1, "Default locale is required").openapi({ description: "The default locale for the manufacturer" }), logoId: m.string().nullable().optional().openapi({ example: "clf9876543210abcdef", description: "ID reference to the manufacturer's logo file" }), translations: m.array(m.object({ locale: m.string().min(1, "Locale is required").openapi({ example: "en-US", description: "Locale code for the translation" }), about: m.string().max(6e3, "Maximum character limit is 6000").nullable().optional().openapi({ example: "Apple Inc. is a multinational technology company.", description: "Description about the manufacturer in the specified locale" }) })).optional().openapi({ description: "List of translations for the manufacturer" }) }).openapi("UpdateManufacturer");
|
|
440
|
-
m.object({ id: m.string().openapi({ example: "clm1234567890abcdef", description: "The unique identifier of the legal entity" }), name: m.string().openapi({ example: "Acme Corporation", description: "The name of the legal entity" }), taxId: m.string().min(2).max(20).openapi({ example: "PL1234567890", description: "The TAX ID of the legal entity" }), email: m.string().email().nullable().openapi({ example: "contact@acme.com", description: "The email of the legal entity", format: "email" }), phone: m.string().nullable().openapi({ example: "+48123456789", description: "The phone number of the legal entity" }), createdAt: m.date().openapi({ description: "The date and time when the legal entity was created", format: "date-time" }), address: ha.required().openapi({ description: "The address of the legal entity" }) }).openapi("LegalEntity"), m.object({ name: m.string().min(1, "Name is required").openapi({ example: "Acme Corporation", description: "The name of the legal entity" }), taxId: m.string().min(2).max(20).openapi({ example: "PL1234567890", description: "The TAX ID of the legal entity" }), email: m.string().email().optional().openapi({ example: "contact@acme.com", description: "The email of the legal entity", format: "email" }), phone: m.string().optional().openapi({ example: "+48123456789", description: "The phone number of the legal entity" }), address: At.required().openapi({ description: "The address of the legal entity" }) }).openapi("CreateLegalEntity"), m.object({ name: m.string().min(1, "Name is required").optional().openapi({ example: "Acme Corporation", description: "The name of the legal entity" }), taxId: m.string().min(2).max(20).openapi({ example: "PL1234567890", description: "The TAX ID of the legal entity" }), email: m.string().email().optional().openapi({ example: "contact@acme.com", description: "The email of the legal entity", format: "email" }), phone: m.string().optional().openapi({ example: "+48123456789", description: "The phone number of the legal entity" }), address:
|
|
440
|
+
m.object({ id: m.string().openapi({ example: "clm1234567890abcdef", description: "The unique identifier of the legal entity" }), name: m.string().openapi({ example: "Acme Corporation", description: "The name of the legal entity" }), taxId: m.string().min(2).max(20).openapi({ example: "PL1234567890", description: "The TAX ID of the legal entity" }), email: m.string().email().nullable().openapi({ example: "contact@acme.com", description: "The email of the legal entity", format: "email" }), phone: m.string().nullable().openapi({ example: "+48123456789", description: "The phone number of the legal entity" }), createdAt: m.date().openapi({ description: "The date and time when the legal entity was created", format: "date-time" }), address: ha.required().openapi({ description: "The address of the legal entity" }) }).openapi("LegalEntity"), m.object({ name: m.string().min(1, "Name is required").openapi({ example: "Acme Corporation", description: "The name of the legal entity" }), taxId: m.string().min(2).max(20).openapi({ example: "PL1234567890", description: "The TAX ID of the legal entity" }), email: m.string().email().optional().openapi({ example: "contact@acme.com", description: "The email of the legal entity", format: "email" }), phone: m.string().optional().openapi({ example: "+48123456789", description: "The phone number of the legal entity" }), address: At.required().openapi({ description: "The address of the legal entity" }) }).openapi("CreateLegalEntity"), m.object({ name: m.string().min(1, "Name is required").optional().openapi({ example: "Acme Corporation", description: "The name of the legal entity" }), taxId: m.string().min(2).max(20).openapi({ example: "PL1234567890", description: "The TAX ID of the legal entity" }), email: m.string().email().optional().openapi({ example: "contact@acme.com", description: "The email of the legal entity", format: "email" }), phone: m.string().optional().openapi({ example: "+48123456789", description: "The phone number of the legal entity" }), address: mn.required().openapi({ description: "The address of the legal entity" }) }).openapi("UpdateLegalEntity");
|
|
441
441
|
const Eo = m.object({ id: m.string().openapi({ example: "clf9876543210abcdef", description: "ID of the customer" }), firstname: m.string().nullable().optional().openapi({ example: "John Doe", description: "Name of the customer" }), email: m.string().nullable().optional().openapi({ example: "john.doe@example.com", description: "Email of the customer" }), phone: m.string().nullable().optional().openapi({ example: "+1234567890", description: "Phone number of the customer" }), address: ha.nullable().optional().openapi({ description: "Address of the customer" }), createdAt: m.date(), updatedAt: m.date() }).openapi("Customer"), zo = Eo.pick({ firstname: !0, email: !0, phone: !0 }).extend({ address: At }).openapi("Customer");
|
|
442
442
|
zo.partial().openapi("UpdateCustomer");
|
|
443
|
-
const
|
|
443
|
+
const cr = m.object({ email: m.string().min(1, "Email is required").email("Invalid email").openapi({ example: "user@example.com", description: "User's email address" }), password: m.string().min(1, "Password is required").min(8, "Password must be more than 8 characters").max(32, "Password must be less than 32 characters").openapi({ example: "password123", description: "User's password" }), firstname: m.string().min(1, "First name is required").max(32, "First name must be less than 32 characters").openapi({ example: "John", description: "User's first name" }), lastname: m.string().min(1, "Last name is required").max(32, "Last name must be less than 32 characters").openapi({ example: "Doe", description: "User's last name" }) }).openapi("SignUp"), yn = cr.pick({ email: !0, password: !0 }).openapi("SignIn"), Do = m.object({ organizationId: m.string().cuid().min(1, "organizationId is required").openapi({ example: "ckel0e8qw00004n5p5w6fznym", description: "The organization ID" }) }).openapi("OrganizationParams");
|
|
444
444
|
Do.extend({ id: m.string().cuid().min(1, "id is required").openapi({ example: "ckel0e8qw00004n5p5w6fznym", description: "The organization ID" }) }).openapi("OrganizationWithIdParams"), m.object({ placeId: m.string().openapi({ example: "ChIJN1t_tKlj4AR4GeTYWZ7frY", description: "The Google Place ID for the address" }), text: m.string().openapi({ example: "123 Main Street, New York, USA", description: "The description of the place" }), addressLineOne: m.string().openapi({ example: "123 Main Street", description: "The first line of the address" }), addressLineTwo: m.string().optional().openapi({ example: "Suite 100", description: "The second line of the address" }), latitude: m.number().optional().openapi({ example: 40.712776, description: "The latitude of the coordinate" }), longitude: m.number().optional().openapi({ example: -74.005974, description: "The longitude of the coordinate" }) }).openapi("Place"), m.object({ addressLineOne: m.string().openapi({ example: "123 Main Street", description: "The first line of the address" }), zipCode: m.string().optional().openapi({ example: "12345", description: "The postal code of the address" }), city: m.string().openapi({ example: "New York", description: "The city of the address" }), country: m.string().openapi({ example: "USA", description: "The ISO 3166-1 alpha-2 country code" }) }).openapi("PlaceDetails");
|
|
445
445
|
const Fo = m.object({ id: m.string().openapi({ description: "Unique identifier for the order", example: "clj1234567890abcdef" }), firstname: m.string().openapi({ description: "Customer's first name", example: "John" }), lastname: m.string().openapi({ description: "Customer's last name", example: "Doe" }), guests: tt, phone: m.string().openapi({ description: "Customer's phone number", example: "+1234567890" }), date: m.coerce.date().openapi({ description: "Reservation date and time", example: "2023-06-14T16:20:00Z" }), referenceId: m.string().openapi({ description: "External reference ID for the order", example: "ORD-12345" }), acceptedAt: m.date().nullable().optional().openapi({ description: "Date when the order was accepted", example: "2023-06-15T14:30:00Z" }), cancelledAt: m.date().nullable().optional().openapi({ description: "Date when the order was cancelled", example: "2023-06-14T16:20:00Z" }), createdAt: m.date().nullable().optional().openapi({ description: "Date when the order was created", example: "2023-06-14T16:20:00Z" }) }).openapi("Reservation"), Ro = Fo.pick({ firstname: !0, lastname: !0, guests: !0, phone: !0, date: !0 }).openapi("CreateReservation");
|
|
446
446
|
function ia(...a) {
|
|
447
447
|
return Zi(Vi(...a));
|
|
448
448
|
}
|
|
449
|
-
const
|
|
449
|
+
const bn = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], ga = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], Bo = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"], Mo = Le({ base: ["relative inline-flex items-center justify-center whitespace-nowrap rounded-lg border px-3 py-2 text-center text-sm font-medium shadow-2xs transition-all duration-100 ease-in-out cursor-pointer", "disabled:pointer-events-none disabled:shadow-none disabled:cursor-not-allowed", ga], variants: { variant: { primary: ["border-transparent", "storefront-primary-action"], secondary: ["border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "hover:bg-gray-50 dark:hover:bg-gray-900/60", "disabled:text-gray-400", "dark:disabled:text-gray-600"], light: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-gray-200 dark:bg-gray-900", "hover:bg-gray-300/70 dark:hover:bg-gray-800/80", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:bg-gray-800 dark:disabled:text-gray-600"], ghost: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800/80", "disabled:text-gray-400", "dark:disabled:text-gray-600"], destructive: ["text-white", "border-transparent", "bg-red-600 dark:bg-red-700", "hover:bg-red-700 dark:hover:bg-red-600", "disabled:bg-red-300 disabled:text-white", "dark:disabled:bg-red-950 dark:disabled:text-red-400"] } }, defaultVariants: { variant: "primary" } }), Y = S.forwardRef(({ asChild: a, isLoading: t = !1, loadingText: r, className: n, disabled: s, variant: l, children: o, ...d }, u) => e(a ? tr : "button", { ref: u, className: x(Mo({ variant: l }), n), disabled: s || t, ...d, children: t ? i("span", { className: "pointer-events-none flex shrink-0 items-center justify-center gap-1.5", children: [e(Ri, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }), e("span", { className: "sr-only", children: r || "Loading" }), r || "Loading"] }) : o }));
|
|
450
450
|
Y.displayName = "Button";
|
|
451
|
-
const
|
|
451
|
+
const Wr = [{ continent: "America", items: [{ value: "US", label: "United States", flag: "🇺🇸" }, { value: "CA", label: "Canada", flag: "🇨🇦" }, { value: "MX", label: "Mexico", flag: "🇲🇽" }, { value: "BR", label: "Brazil", flag: "🇧🇷" }, { value: "AR", label: "Argentina", flag: "🇦🇷" }, { value: "CO", label: "Colombia", flag: "🇨🇴" }, { value: "CL", label: "Chile", flag: "🇨🇱" }, { value: "PE", label: "Peru", flag: "🇵🇪" }] }, { continent: "Europe", items: [{ value: "GB", label: "United Kingdom", flag: "🇬🇧" }, { value: "FR", label: "France", flag: "🇫🇷" }, { value: "DE", label: "Germany", flag: "🇩🇪" }, { value: "PL", label: "Poland", flag: "🇵🇱" }, { value: "IT", label: "Italy", flag: "🇮🇹" }, { value: "ES", label: "Spain", flag: "🇪🇸" }, { value: "NL", label: "Netherlands", flag: "🇳🇱" }, { value: "PT", label: "Portugal", flag: "🇵🇹" }, { value: "SE", label: "Sweden", flag: "🇸🇪" }, { value: "NO", label: "Norway", flag: "🇳🇴" }, { value: "DK", label: "Denmark", flag: "🇩🇰" }, { value: "FI", label: "Finland", flag: "🇫🇮" }, { value: "CH", label: "Switzerland", flag: "🇨🇭" }, { value: "IE", label: "Ireland", flag: "🇮🇪" }, { value: "BE", label: "Belgium", flag: "🇧🇪" }, { value: "AT", label: "Austria", flag: "🇦🇹" }, { value: "GR", label: "Greece", flag: "🇬🇷" }] }, { continent: "Asia", items: [{ value: "CN", label: "China", flag: "🇨🇳" }, { value: "JP", label: "Japan", flag: "🇯🇵" }, { value: "IN", label: "India", flag: "🇮🇳" }, { value: "KR", label: "South Korea", flag: "🇰🇷" }, { value: "SG", label: "Singapore", flag: "🇸🇬" }, { value: "MY", label: "Malaysia", flag: "🇲🇾" }, { value: "ID", label: "Indonesia", flag: "🇮🇩" }, { value: "TH", label: "Thailand", flag: "🇹🇭" }, { value: "VN", label: "Vietnam", flag: "🇻🇳" }, { value: "AE", label: "United Arab Emirates", flag: "🇦🇪" }, { value: "SA", label: "Saudi Arabia", flag: "🇸🇦" }] }, { continent: "Oceania", items: [{ value: "AU", label: "Australia", flag: "🇦🇺" }, { value: "NZ", label: "New Zealand", flag: "🇳🇿" }, { value: "FJ", label: "Fiji", flag: "🇫🇯" }, { value: "PG", label: "Papua New Guinea", flag: "🇵🇬" }] }, { continent: "Africa", items: [{ value: "ZA", label: "South Africa", flag: "🇿🇦" }, { value: "NG", label: "Nigeria", flag: "🇳🇬" }, { value: "MA", label: "Morocco", flag: "🇲🇦" }, { value: "EG", label: "Egypt", flag: "🇪🇬" }, { value: "KE", label: "Kenya", flag: "🇰🇪" }, { value: "GH", label: "Ghana", flag: "🇬🇭" }, { value: "ET", label: "Ethiopia", flag: "🇪🇹" }] }], Ct = (a) => e($.Root, { ...a });
|
|
452
452
|
Ct.displayName = "Dialog";
|
|
453
453
|
const Po = $.Trigger;
|
|
454
454
|
Po.displayName = "DialogTrigger";
|
|
455
455
|
const Qo = $.Close;
|
|
456
456
|
Qo.displayName = "DialogClose";
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
const St = S.forwardRef(({ className: a, ...t }, r) => e(
|
|
457
|
+
const xn = $.Portal;
|
|
458
|
+
xn.displayName = "DialogPortal";
|
|
459
|
+
const wn = S.forwardRef(({ className: a, ...t }, r) => e($.Overlay, { ref: r, className: x("fixed inset-0 z-50 overflow-y-auto", "bg-black/70", "data-[state=open]:animate-dialogOverlayShow", a), ...t }));
|
|
460
|
+
wn.displayName = "DialogOverlay";
|
|
461
|
+
const St = S.forwardRef(({ className: a, ...t }, r) => e(xn, { children: e(wn, { children: e($.Content, { ref: r, className: x("fixed left-1/2 top-1/2 z-50 w-[95vw] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-md border p-6 shadow-lg", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=open]:animate-dialogContentShow", ga, a), ...t }) }) }));
|
|
462
462
|
St.displayName = "DialogContent";
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
|
|
463
|
+
const kn = ({ className: a, ...t }) => e("div", { className: x("flex flex-col gap-y-1", a), ...t });
|
|
464
|
+
kn.displayName = "DialogHeader";
|
|
465
|
+
const mr = S.forwardRef(({ className: a, ...t }, r) => e($.Title, { ref: r, className: x("text-lg font-semibold", "text-gray-900 dark:text-gray-50", a), ...t }));
|
|
466
|
+
mr.displayName = "DialogTitle";
|
|
467
467
|
const To = S.forwardRef(({ className: a, ...t }, r) => e($.Description, { ref: r, className: x("text-gray-500 dark:text-gray-500", a), ...t }));
|
|
468
468
|
To.displayName = "DialogDescription";
|
|
469
469
|
const Jo = ({ className: a, ...t }) => e("div", { className: x("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a), ...t });
|
|
470
470
|
Jo.displayName = "DialogFooter";
|
|
471
471
|
const It = A.forwardRef(({ className: a, ...t }, r) => e(Z, { ref: r, className: x("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", a), ...t }));
|
|
472
472
|
It.displayName = Z.displayName;
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
473
|
+
const np = ({ children: a, ...t }) => e(Ct, { ...t, children: e(St, { className: "overflow-hidden p-0", children: e(It, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: a }) }) }), ur = A.forwardRef(({ className: a, ...t }, r) => i("div", { className: "flex items-center border-b pl-3", "cmdk-input-wrapper": "", children: [e(Kt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), e(Z.Input, { ref: r, className: x("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", a), ...t })] }));
|
|
474
|
+
ur.displayName = Z.Input.displayName;
|
|
475
|
+
const pr = A.forwardRef(({ className: a, ...t }, r) => e(Z.List, { ref: r, className: x("max-h-[300px] overflow-y-auto overflow-x-hidden", a), ...t }));
|
|
476
|
+
pr.displayName = Z.List.displayName;
|
|
477
|
+
const hr = A.forwardRef((a, t) => e(Z.Empty, { ref: t, className: "py-6 text-center text-sm", ...a }));
|
|
478
|
+
hr.displayName = Z.Empty.displayName;
|
|
479
|
+
const gr = A.forwardRef(({ className: a, ...t }, r) => e(Z.Group, { ref: r, className: x("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", a), ...t }));
|
|
480
|
+
gr.displayName = Z.Group.displayName;
|
|
481
481
|
const Oo = A.forwardRef(({ className: a, ...t }, r) => e(Z.Separator, { ref: r, className: x("-mx-1 h-px bg-border", a), ...t }));
|
|
482
482
|
Oo.displayName = Z.Separator.displayName;
|
|
483
|
-
const
|
|
484
|
-
|
|
483
|
+
const fr = A.forwardRef(({ className: a, ...t }, r) => e(Z.Item, { ref: r, className: x("relative flex cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", a), ...t }));
|
|
484
|
+
fr.displayName = Z.Item.displayName;
|
|
485
485
|
const Lo = ({ className: a, ...t }) => e("span", { className: x("ml-auto text-xs tracking-widest text-muted-foreground", a), ...t });
|
|
486
486
|
Lo.displayName = "CommandShortcut";
|
|
487
487
|
const Ra = (a) => e(G.Root, { ...a });
|
|
@@ -497,18 +497,18 @@ const Ma = A.forwardRef(({ className: a, sideOffset: t = 10, side: r = "bottom",
|
|
|
497
497
|
}, ...l }) }));
|
|
498
498
|
Ma.displayName = "PopoverContent";
|
|
499
499
|
const Zo = ({ value: a, onChange: t, disabled: r }) => {
|
|
500
|
-
const n = Fe(), [s, l] = F(!1), o =
|
|
501
|
-
return e("div", { className: "mt-2", children: i(Ra, { open: r ? !1 : s, onOpenChange: r ? void 0 : l, children: [e(Ba, { asChild: !0, children: i(Y, { id: n, role: "combobox", disabled: r, "aria-expanded": s, variant: "secondary", className: "w-full justify-between shadow-2xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20 disabled:opacity-50 disabled:cursor-not-allowed", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2 mr-auto", children: [e("span", { className: "text-lg leading-none", children: o == null ? void 0 : o.flag }), e("span", { className: "truncate", children: o == null ? void 0 : o.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Ma, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50", align: "start", children: i(It, { className: "p-0", children: [e(
|
|
500
|
+
const n = Fe(), [s, l] = F(!1), o = Wr.map((d) => d.items.find((u) => u.value === a)).filter(Boolean)[0];
|
|
501
|
+
return e("div", { className: "mt-2", children: i(Ra, { open: r ? !1 : s, onOpenChange: r ? void 0 : l, children: [e(Ba, { asChild: !0, children: i(Y, { id: n, role: "combobox", disabled: r, "aria-expanded": s, variant: "secondary", className: "w-full justify-between shadow-2xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20 disabled:opacity-50 disabled:cursor-not-allowed", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2 mr-auto", children: [e("span", { className: "text-lg leading-none", children: o == null ? void 0 : o.flag }), e("span", { className: "truncate", children: o == null ? void 0 : o.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Ma, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50", align: "start", children: i(It, { className: "p-0", children: [e(ur, { className: "w-full border-none", style: { boxShadow: "none" }, placeholder: "Search country..." }), i(pr, { children: [e(hr, { children: "No country found." }), Wr.map((d) => e(ca, { children: e(gr, { heading: d.continent, children: d.items.map((u) => i(fr, { value: u.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => {
|
|
502
502
|
t(u.value ?? ""), l(!1);
|
|
503
503
|
}, children: [e("span", { className: "text-lg leading-none", children: u.flag }), " ", u.label, a === u.value && e(Ea, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, u.value)) }) }, d.continent))] })] }) })] }) });
|
|
504
|
-
}, Ho = Le({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 shadow-2xs outline-hidden transition sm:text-sm", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-white dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500",
|
|
504
|
+
}, Ho = Le({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 shadow-2xs outline-hidden transition sm:text-sm", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-white dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", bn], variants: { hasError: { true: Bo }, enableStepper: { false: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none" }, multiline: { true: "resize-y min-h-[100px]", false: "truncate appearance-none" } } }), De = S.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n = !0, type: s, multiline: l = !1, prefix: o, suffix: d, ...u }, c) => {
|
|
505
505
|
const [h, p] = S.useState(s), g = s === "password" && !l, b = s === "search" && !l, f = s === "textarea" ? "textarea" : "input";
|
|
506
|
-
return i("div", { className: x("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(f, { ref: c, type: g ? h : s, className: x(Ho({ hasError: r, enableStepper: l ? !1 : n, multiline: l }), { "pl-16": o, "pl-8": !o && b, "pr-10": d || !d && g }, t), ...u }), !o && b && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2 text-gray-400 dark:text-gray-600", children: e(
|
|
506
|
+
return i("div", { className: x("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(f, { ref: c, type: g ? h : s, className: x(Ho({ hasError: r, enableStepper: l ? !1 : n, multiline: l }), { "pl-16": o, "pl-8": !o && b, "pr-10": d || !d && g }, t), ...u }), !o && b && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2 text-gray-400 dark:text-gray-600", children: e(Xt, { className: "size-[1.125rem]" }) }), d && e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400 dark:text-gray-600", children: d }), !d && g && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: e("button", { onClick: () => p(h === "password" ? "text" : "password"), className: x(ga, "text-gray-400 hover:text-gray-500 dark:text-gray-600"), children: h === "password" ? e(Bi, { className: "size-5" }) : e(Mi, { className: "size-5" }) }) })] });
|
|
507
507
|
});
|
|
508
508
|
De.displayName = "Input";
|
|
509
509
|
const Uo = ({ ...a }) => {
|
|
510
510
|
const t = Fe();
|
|
511
|
-
return e("div", { className: "mt-2", children: i("div", { className: "relative", children: [e(De, { id: t, type: "email", inputClassName: "peer ps-9", ...a }), e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: e(
|
|
511
|
+
return e("div", { className: "mt-2", children: i("div", { className: "relative", children: [e(De, { id: t, type: "email", inputClassName: "peer ps-9", ...a }), e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: e(Ds, { size: 16 }) })] }) });
|
|
512
512
|
}, qo = (a) => {
|
|
513
513
|
const { client: t } = I(), [r, n] = F(!1), [s, l] = F(0), o = async (c) => {
|
|
514
514
|
const { body: h, status: p } = await t.file.createTemporaryFile({ body: { filename: c.name, mimeType: c.type, size: c.size, organizationId: a.organizationId } });
|
|
@@ -547,7 +547,7 @@ const Uo = ({ ...a }) => {
|
|
|
547
547
|
}
|
|
548
548
|
return i("div", { className: "group flex relative flex-col items-center justify-center cursor-pointer w-full h-40 border-2 border-gray-200 border-dashed transition-all rounded-lg hover:bg-gray-100 hover:border-gray-300", children: [e("div", { className: "flex flex-col items-center justify-center", children: r ? i(C, { children: [e("svg", { className: "animate-spin w-4 h-4 fill-current shrink-0 mb-2", viewBox: "0 0 16 16", children: e("path", { d: "M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z" }) }), i("span", { className: "text-sm", children: ["Uploading... (", s, "%)"] })] }) : i(C, { children: [e(Ya, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }), e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })] }) }), e("input", { type: "file", className: "opacity-0 w-full h-full absolute cursor-pointer", onChange: d, accept: "image/png, image/gif, image/jpeg" })] }, "upload-placeholder");
|
|
549
549
|
})() });
|
|
550
|
-
},
|
|
550
|
+
}, yr = ({ value: a, onChange: t, placeholder: r = "Search for a place" }) => {
|
|
551
551
|
const { client: n } = I(), s = Fe(), [l, o] = F(!1), [d, u] = F(""), [c, h] = F(null), p = mi(null), [g] = qe(d, 300);
|
|
552
552
|
ee(() => {
|
|
553
553
|
a && (c == null ? void 0 : c.text) !== a && u(a);
|
|
@@ -564,19 +564,19 @@ const Uo = ({ ...a }) => {
|
|
|
564
564
|
};
|
|
565
565
|
return ee(() => {
|
|
566
566
|
l && p.current && p.current.focus();
|
|
567
|
-
}, [l]), i("div", { className: "mt-2 relative", children: [i(Ra, { open: l, onOpenChange: o, children: [e(Ba, { asChild: !0, children: i(Y, { id: s, role: "combobox", "aria-expanded": l, variant: "secondary", className: "w-full shadow-2xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", onClick: () => o(!l), children: [a ? e("span", { className: "px-1 text-sm truncate mr-auto", children: a }) : e("span", { className: "px-1 text-sm text-gray-400 mr-auto", children: r }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), i(Ma, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: [i("div", { className: "flex items-center border-b px-3 py-2", children: [e(
|
|
567
|
+
}, [l]), i("div", { className: "mt-2 relative", children: [i(Ra, { open: l, onOpenChange: o, children: [e(Ba, { asChild: !0, children: i(Y, { id: s, role: "combobox", "aria-expanded": l, variant: "secondary", className: "w-full shadow-2xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", onClick: () => o(!l), children: [a ? e("span", { className: "px-1 text-sm truncate mr-auto", children: a }) : e("span", { className: "px-1 text-sm text-gray-400 mr-auto", children: r }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), i(Ma, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: [i("div", { className: "flex items-center border-b px-3 py-2", children: [e(Kt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), e("input", { ref: p, placeholder: "Search places...", className: "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", value: d, onChange: (k) => {
|
|
568
568
|
u(k.target.value), k.target.value.length >= 2 && o(!0);
|
|
569
|
-
} })] }), i("div", { className: "max-h-[300px] overflow-y-auto", children: [w && i("div", { className: "py-6 text-center", children: [e(
|
|
570
|
-
},
|
|
571
|
-
|
|
572
|
-
const Wo = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { className: "relative inline-flex items-center self-stretch rounded-s-lg border border-gray-200 dark:border-gray-800 bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-hidden focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50", children: [i("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [e(
|
|
569
|
+
} })] }), i("div", { className: "max-h-[300px] overflow-y-auto", children: [w && i("div", { className: "py-6 text-center", children: [e(Fs, { className: "h-4 w-4 animate-spin mx-auto" }), e("p", { className: "text-sm text-muted-foreground mt-2", children: "Searching places..." })] }), !w && d.length < 2 && e("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "Type at least 2 characters to search" }), !w && d.length >= 2 && b.length === 0 && e("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No places found" }), !w && d.length >= 2 && b.length > 0 && i("div", { className: "py-1", children: [i("div", { className: "px-2 py-1 text-xs text-muted-foreground", children: ["Found ", b.length, " results"] }), b.map((k, v) => i("div", { className: "relative flex cursor-pointer select-none items-center rounded-xs px-2 py-2 text-sm outline-hidden hover:bg-gray-100 dark:hover:bg-gray-800", onClick: () => y(k), children: [i("div", { className: "flex flex-col grow", children: [e("span", { children: k.addressLineOne || k.text }), k.addressLineTwo && e("span", { className: "text-xs text-muted-foreground", children: k.addressLineTwo })] }), (c == null ? void 0 : c.placeId) === k.placeId && e(Ea, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, `${k.placeId || "place"}-${v}`))] })] })] })] }), f && i("p", { className: "text-xs text-red-500 mt-1", children: ["Error fetching results: ", f.message] })] });
|
|
570
|
+
}, vn = ui(({ ...a }, t) => e(De, { ...a, inputClassName: "border-l-0 rounded-l-none", ref: t, className: "" }));
|
|
571
|
+
vn.displayName = "PhoneInput";
|
|
572
|
+
const Wo = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { className: "relative inline-flex items-center self-stretch rounded-s-lg border border-gray-200 dark:border-gray-800 bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-hidden focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50", children: [i("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [e(Nn, { country: t, countryName: t, "aria-hidden": "true" }), e("span", { className: "text-muted-foreground/80", children: e(na, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })] }), i("select", { disabled: a, value: t, onChange: (s) => {
|
|
573
573
|
r(s.target.value);
|
|
574
|
-
}, className: "absolute inset-0 text-sm opacity-0", "aria-label": "Select country", children: [e("option", { value: "", children: "Select a country" }, "default"), n.filter((s) => s.value).map((s, l) => i("option", { value: s.value, children: [s.label, " ", s.value && `+${bt.getCountryCallingCode(s.value)}`] }, s.value ?? `empty-${l}`))] })] }),
|
|
574
|
+
}, className: "absolute inset-0 text-sm opacity-0", "aria-label": "Select country", children: [e("option", { value: "", children: "Select a country" }, "default"), n.filter((s) => s.value).map((s, l) => i("option", { value: s.value, children: [s.label, " ", s.value && `+${bt.getCountryCallingCode(s.value)}`] }, s.value ?? `empty-${l}`))] })] }), Nn = ({ country: a, countryName: t }) => {
|
|
575
575
|
const r = Ui[a];
|
|
576
576
|
return e("span", { className: "w-5 overflow-hidden rounded-xs", children: r ? e(r, { title: t }) : e(yi, { size: 16, "aria-hidden": "true" }) });
|
|
577
577
|
}, _o = ({ value: a, onChange: t, onBlur: r }) => {
|
|
578
578
|
const n = Fe();
|
|
579
|
-
return e("div", { className: "mt-2", children: e(bt.default, { id: n, className: "flex rounded-lg shadow-2xs shadow-black/5", international: !0, flagComponent:
|
|
579
|
+
return e("div", { className: "mt-2", children: e(bt.default, { id: n, className: "flex rounded-lg shadow-2xs shadow-black/5", international: !0, flagComponent: Nn, countrySelectComponent: Wo, inputComponent: vn, placeholder: "Enter phone number", value: a, onChange: (s) => t(s ?? ""), onBlur: r }) });
|
|
580
580
|
}, $o = ({ options: a, value: t, onChange: r, multiple: n = !1, placeholder: s }) => {
|
|
581
581
|
var h;
|
|
582
582
|
const l = Fe(), [o, d] = F(!1), u = (p) => {
|
|
@@ -595,17 +595,17 @@ const Wo = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { cl
|
|
|
595
595
|
return g ? i("span", { className: "animate-fadeIn relative inline-flex cursor-default items-center rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50", children: [g.label, e(za, { size: 12, onClick: (b) => {
|
|
596
596
|
b.preventDefault(), c(p);
|
|
597
597
|
}, className: "cursor-pointer ml-1" })] }, p) : null;
|
|
598
|
-
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((p) => p.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Ma, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: i(It, { className: "p-0", children: [e(
|
|
599
|
-
}, Go = Le({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800", ga], thumb: ["pointer-events-none relative inline-block transform appearance-none rounded-full border-none shadow-lg outline-hidden transition-all duration-150 ease-in-out focus:border-none focus:outline-hidden focus:outline-transparent", "bg-white dark:bg-gray-50", "group-data-disabled:shadow-none", "group-data-disabled:bg-gray-50 dark:group-data-disabled:bg-gray-500"] }, variants: { size: { default: { root: "h-7 w-14", thumb: "h-4 w-4 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0" }, small: { root: "h-4 w-7", thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0" } } }, defaultVariants: { size: "default" } }),
|
|
598
|
+
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((p) => p.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(Ma, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: i(It, { className: "p-0", children: [e(ur, { className: "w-full border-none pl-0", style: { boxShadow: "none" }, placeholder: "Search..." }), i(pr, { children: [e(hr, { children: "No options found." }), e(gr, { children: a.map((p) => i(fr, { value: p.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => u(p.value), children: [p.label, (n ? t.includes(p.value) : t === p.value) && e(Ea, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, p.value)) })] })] }) })] }) });
|
|
599
|
+
}, Go = Le({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800", ga], thumb: ["pointer-events-none relative inline-block transform appearance-none rounded-full border-none shadow-lg outline-hidden transition-all duration-150 ease-in-out focus:border-none focus:outline-hidden focus:outline-transparent", "bg-white dark:bg-gray-50", "group-data-disabled:shadow-none", "group-data-disabled:bg-gray-50 dark:group-data-disabled:bg-gray-500"] }, variants: { size: { default: { root: "h-7 w-14", thumb: "h-4 w-4 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0" }, small: { root: "h-4 w-7", thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0" } } }, defaultVariants: { size: "default" } }), An = S.forwardRef(({ className: a, size: t, ...r }, n) => {
|
|
600
600
|
const { root: s, thumb: l } = Go({ size: t });
|
|
601
601
|
return e(et.Root, { ref: n, className: x(s(), a), ...r, children: e(et.Thumb, { className: x(l()) }) });
|
|
602
602
|
});
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
function
|
|
603
|
+
An.displayName = "Switch";
|
|
604
|
+
const Cn = S.forwardRef(({ className: a, type: t, ...r }, n) => e("input", { type: t, className: ia("flex h-10 w-full rounded-md border border-gray-200 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-50 dark:placeholder:text-gray-500", a), ref: n, ...r }));
|
|
605
|
+
Cn.displayName = "TextInput";
|
|
606
|
+
function Sn({ className: a, ...t }) {
|
|
607
607
|
const r = Fe();
|
|
608
|
-
return e(
|
|
608
|
+
return e(Cn, { id: r, placeholder: "00:00", className: x(a, "mt-2"), ref: Us("99:99", { placeholder: "-", showMaskOnHover: !1 }), ...t });
|
|
609
609
|
}
|
|
610
610
|
const Ee = A.forwardRef(({ className: a, disabled: t, ...r }, n) => e(Hi.Root, { ref: n, className: ia("text-sm leading-none font-medium", "text-gray-900 dark:text-gray-50", { "text-gray-400 dark:text-gray-600": t }, a), "aria-disabled": t, ...r }));
|
|
611
611
|
Ee.displayName = "Label";
|
|
@@ -673,11 +673,11 @@ const Ko = ({ value: a, onChange: t, disabled: r }) => {
|
|
|
673
673
|
return e($o, { options: s, value: p, onChange: (g) => h(g), placeholder: r, multiple: n });
|
|
674
674
|
}
|
|
675
675
|
case "switch":
|
|
676
|
-
return e(
|
|
676
|
+
return e(An, { size: "default", className: "mt-2", value: d(a), onCheckedChange: (p) => h(p) });
|
|
677
677
|
case "location":
|
|
678
|
-
return e(
|
|
678
|
+
return e(yr, { value: d(a), onChange: (p) => h(p.addressLineOne) });
|
|
679
679
|
case "time":
|
|
680
|
-
return e(
|
|
680
|
+
return e(Sn, { value: d(a), ...u(a) });
|
|
681
681
|
default:
|
|
682
682
|
return e(De, { ...u(a), type: t, rows: t === "textarea" ? 4 : void 0, placeholder: r, className: "mt-2", prefix: o });
|
|
683
683
|
}
|
|
@@ -686,7 +686,7 @@ const Ko = ({ value: a, onChange: t, disabled: r }) => {
|
|
|
686
686
|
}, a) : a, xe = ({ type: a = "text", name: t, label: r, className: n, locale: s, placeholder: l, multiple: o, options: d, localizable: u, prefix: c, disabled: h }) => {
|
|
687
687
|
const { errors: p } = ct(), g = Xo(p, t);
|
|
688
688
|
return i("div", { className: x("w-full", n), children: [typeof r == "string" && i(Ee, { htmlFor: t, className: "font-medium flex items-center justify-between", children: [i("span", { className: "flex items-center", children: [r, u && e(bi, { className: "w-4 h-4 ml-1 text-gray-500" })] }), s && u && i("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded-sm", children: [vt.get(s), " (", s, ")"] })] }), e(Yo, { type: a, name: t, placeholder: l, options: d, multiple: o, prefix: c, disabled: h }), (g == null ? void 0 : g.message) && e("p", { className: "mt-1 text-sm text-red-500", children: g.message })] });
|
|
689
|
-
}, ed = ({ isOpen: a, onClose: t, children: r }) => e(Di, { show: a, as: ca, children: e(
|
|
689
|
+
}, ed = ({ isOpen: a, onClose: t, children: r }) => e(Di, { show: a, as: ca, children: e(qs, { as: "div", className: "fixed inset-0 overflow-hidden", onClose: t, children: i("div", { className: "absolute inset-0 overflow-hidden", children: [e(Qr, { as: ca, enter: "ease-in-out duration-500", enterFrom: "opacity-0", enterTo: "opacity-100", leave: "ease-in-out duration-500", leaveFrom: "opacity-100", leaveTo: "opacity-0", children: e("div", { className: "fixed inset-0 bg-black/75 z-20 transition-opacity" }) }), e("div", { className: "fixed h-1/2 top-0 right-0 z-30 max-w-full flex", children: e(Qr, { as: ca, enter: "transform transition ease-in-out duration-500", enterFrom: "-translate-y-full", enterTo: "translate-y-0", leave: "transform transition ease-in-out duration-500", leaveFrom: "translate-y-0", leaveTo: "-translate-y-full", children: e(Ws, { className: "relative w-screen h-full", children: e("div", { className: "max-h-screen bg-gray-900 flex flex-col py-6 shadow-xl overflow-y-scroll", children: r }) }) }) })] }) }) }), ad = x("hidden h-6 select-none items-center justify-center rounded-md bg-gray-800 px-2 font-mono text-xs text-gray-400 ring-1 ring-inset ring-gray-700 transition sm:flex"), td = ({ open: a = !1, onOpenChange: t, defaultOpen: r = !1, disableAutoFocus: n = !0, children: s }) => i(G.Root, { open: a, onOpenChange: t, defaultOpen: r, children: [e(G.Anchor, { className: x("fixed inset-x-0 bottom-8 mx-auto flex w-fit items-center") }), e(G.Portal, { children: e(G.Content, { side: "top", sideOffset: 0, onOpenAutoFocus: (l) => {
|
|
690
690
|
n && l.preventDefault();
|
|
691
691
|
}, className: x("z-50", "data-[state=closed]:animate-hide", "data-[side=top]:animate-slideUpAndFade"), children: s }) })] });
|
|
692
692
|
td.displayName = "CommandBar";
|
|
@@ -705,18 +705,18 @@ const sd = A.forwardRef(({ className: a, type: t = "button", label: r, action: n
|
|
|
705
705
|
};
|
|
706
706
|
}, [n, s, l]), e("span", { className: x("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: x("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", ga), ...o, children: [e("span", { children: r }), e("span", { className: ad, children: s.label ? s.label.toUpperCase() : s.shortcut.toUpperCase() })] }) })));
|
|
707
707
|
sd.displayName = "CommandBar.Command";
|
|
708
|
-
const Ut = A.forwardRef(({ className: a, ...t }, r) => e(
|
|
708
|
+
const Ut = A.forwardRef(({ className: a, ...t }, r) => e(rr.Root, { ref: r, className: ia("grid gap-2", a), ...t }));
|
|
709
709
|
Ut.displayName = "RadioCardGroup";
|
|
710
|
-
const qt = A.forwardRef(({ className: a, ...t }, r) => e("div", { className: ia("relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-full border shadow-2xs outline-hidden", "border-gray-300 dark:border-gray-800", "bg-white dark:bg-gray-950", "group-data-[state=checked]:border-0 group-data-[state=checked]:border-transparent group-data-[state=checked]:bg-blue-600", "group-data-disabled:border", "group-data-disabled:border-gray-300 group-data-disabled:bg-gray-100 group-data-disabled:text-gray-400", "dark:group-data-disabled:border-gray-700 dark:group-data-disabled:bg-gray-800", ga, a), children: e(
|
|
710
|
+
const qt = A.forwardRef(({ className: a, ...t }, r) => e("div", { className: ia("relative flex size-4 shrink-0 appearance-none items-center justify-center rounded-full border shadow-2xs outline-hidden", "border-gray-300 dark:border-gray-800", "bg-white dark:bg-gray-950", "group-data-[state=checked]:border-0 group-data-[state=checked]:border-transparent group-data-[state=checked]:bg-blue-600", "group-data-disabled:border", "group-data-disabled:border-gray-300 group-data-disabled:bg-gray-100 group-data-disabled:text-gray-400", "dark:group-data-disabled:border-gray-700 dark:group-data-disabled:bg-gray-800", ga, a), children: e(rr.Indicator, { ref: r, className: "flex items-center justify-center", ...t, children: e("div", { className: ia("size size-1.5 shrink-0 rounded-full", "bg-white", "group-data-disabled:bg-gray-400 dark:group-data-disabled:bg-gray-500") }) }) }));
|
|
711
711
|
qt.displayName = "RadioCardGroupIndicator";
|
|
712
|
-
const Wt = A.forwardRef(({ className: a, children: t, ...r }, n) => e(
|
|
712
|
+
const Wt = A.forwardRef(({ className: a, children: t, ...r }, n) => e(rr.Item, { ref: n, className: ia("group relative w-full rounded-lg border p-4 text-left shadow-2xs transition-all focus:outline-hidden", "bg-white dark:bg-gray-950", "border-gray-200 dark:border-gray-800", "data-[state=checked]:border-blue-600 dark:data-[state=checked]:border-blue-600", bn, a), ...r, children: t }));
|
|
713
713
|
Wt.displayName = "RadioCardItem";
|
|
714
714
|
const ld = Le({ base: x("inline-flex items-center gap-x-1 whitespace-nowrap rounded-sm px-1.5 py-0.5 text-xs font-semibold ring-1"), variants: { variant: { default: ["bg-blue-50 text-blue-800 ring-blue-500/30", "dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30"], neutral: ["bg-gray-50 text-gray-700 ring-gray-500/30", "dark:bg-gray-400/10 dark:text-gray-300 dark:ring-gray-400/20"], success: ["bg-emerald-50 text-emerald-800 ring-emerald-600/30", "dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/20"], error: ["bg-red-50 text-red-800 ring-red-600/20", "dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/20"], warning: ["bg-yellow-50 text-yellow-800 ring-yellow-600/30", "dark:bg-yellow-400/10 dark:text-yellow-500 dark:ring-yellow-400/20"] } }, defaultVariants: { variant: "default" } }), Ca = S.forwardRef(({ className: a, variant: t, ...r }, n) => e("span", { ref: n, className: x(ld({ variant: t }), a), ...r }));
|
|
715
715
|
Ca.displayName = "Badge";
|
|
716
716
|
const Sa = S.forwardRef(({ className: a, children: t, ...r }, n) => e("div", { ref: n, className: x("mx-auto my-6 flex w-full items-center justify-between gap-3 text-sm col-span-full", "text-gray-500 dark:text-gray-500", a), ...r, children: t ? i(C, { children: [e("div", { className: x("h-[1px] w-full", "bg-gray-200 dark:bg-gray-800") }), e("div", { className: "whitespace-nowrap text-inherit", children: t }), e("div", { className: x("h-[1px] w-full", "bg-gray-200 dark:bg-gray-800") })] }) : e("div", { className: x("h-[0.5px] w-full", "bg-gray-200 dark:bg-gray-800") }) }));
|
|
717
717
|
Sa.displayName = "Divider";
|
|
718
718
|
const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
719
|
-
const { itemCount: r } =
|
|
719
|
+
const { itemCount: r } = nr(), n = _(), { client: s } = I(), l = me({ resolver: ue(un), reValidateMode: "onChange", defaultValues: a ? { firstname: a.firstname, lastname: a.lastname, phone: a.phone, addressLineOne: a.addressLineOne, placeId: a.placeId, doorNumber: a.doorNumber, zipCode: a.zipCode, city: a.city, country: a.country, deliveryInstructions: a.deliveryInstructions } : void 0 }), o = l.watch("placeId"), d = l.watch("addressLineOne");
|
|
720
720
|
ee(() => {
|
|
721
721
|
(async () => {
|
|
722
722
|
if (o) {
|
|
@@ -739,10 +739,10 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
739
739
|
}, onSuccess: () => n.push(t) }), h = (p) => {
|
|
740
740
|
(a ? c : u).mutate(p);
|
|
741
741
|
};
|
|
742
|
-
return e("div", { className: "flex flex-col gap-4", children: e(Ue, { ...l, children: i("form", { onSubmit: l.handleSubmit(h), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(xe, { name: "firstname", label: "First Name", type: "text", className: "col-span-2", placeholder: "e.g. John" }), e(xe, { name: "lastname", label: "Last Name", type: "text", className: "col-span-2", placeholder: "e.g. Doe" }), e(xe, { name: "phone", label: "Phone", type: "phone-number", className: "col-span-4", placeholder: "e.g. +48 123 456 789" }), i("div", { className: "col-span-4 md:col-span-3 text-sm text-gray-500", children: [e(Ee, { htmlFor: "address.addressLineOne", className: "font-medium flex items-center justify-between", children: "Street Address" }), e(
|
|
742
|
+
return e("div", { className: "flex flex-col gap-4", children: e(Ue, { ...l, children: i("form", { onSubmit: l.handleSubmit(h), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(xe, { name: "firstname", label: "First Name", type: "text", className: "col-span-2", placeholder: "e.g. John" }), e(xe, { name: "lastname", label: "Last Name", type: "text", className: "col-span-2", placeholder: "e.g. Doe" }), e(xe, { name: "phone", label: "Phone", type: "phone-number", className: "col-span-4", placeholder: "e.g. +48 123 456 789" }), i("div", { className: "col-span-4 md:col-span-3 text-sm text-gray-500", children: [e(Ee, { htmlFor: "address.addressLineOne", className: "font-medium flex items-center justify-between", children: "Street Address" }), e(yr, { onChange: (p) => {
|
|
743
743
|
l.setValue("addressLineOne", p.addressLineOne, { shouldValidate: !0, shouldDirty: !0 }), l.setValue("placeId", p.placeId, { shouldValidate: !0, shouldDirty: !0 });
|
|
744
744
|
}, value: d }), l.formState.errors.addressLineOne && e("p", { className: "mt-1 text-sm text-red-500", children: String(l.formState.errors.addressLineOne.message ?? "") })] }), e(xe, { name: "doorNumber", label: "Door Number", type: "text", className: "md:col-span-1 col-span-2", placeholder: "e.g. 123" }), e(xe, { name: "zipCode", label: "Postal Code", type: "text", className: "col-span-2", placeholder: "e.g. 12345" }), e(xe, { name: "city", label: "City", type: "text", className: "col-span-2", placeholder: "e.g. Kraków" }), e(xe, { name: "country", label: "Country", type: "country", className: "col-span-2 md:col-span-4", disabled: !0 }), e(xe, { name: "deliveryInstructions", label: "Notes / Instructions", type: "textarea", className: "col-span-4", placeholder: "e.g. 4th floor, code 12345" })] }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-8", children: [e(Y, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => n.push("/"), children: "Back" }), e(Y, { type: "submit", className: "shadow-none", isLoading: u.isPending || c.isPending, disabled: r === 0, loadingText: "Saving...", children: "Save & Continue" })] })] }) }) });
|
|
745
|
-
}, dd = () => i("div", { className: "animate-pulse space-y-4", children: [i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" })] }), e("div", { className: "h-[70px] bg-gray-100 rounded-sm" }), i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-3" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-1" })] }), i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" })] }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm" }), e("div", { className: "h-[100px] bg-gray-100 rounded-sm" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm mt-8" })] }),
|
|
745
|
+
}, dd = () => i("div", { className: "animate-pulse space-y-4", children: [i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" })] }), e("div", { className: "h-[70px] bg-gray-100 rounded-sm" }), i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-3" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-1" })] }), i("div", { className: "grid grid-cols-4 gap-4", children: [e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm col-span-2" })] }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm" }), e("div", { className: "h-[100px] bg-gray-100 rounded-sm" }), e("div", { className: "h-[40px] bg-gray-100 rounded-sm mt-8" })] }), _r = ({ shippingAndPaymentPageUrl: a = "/checkout/shipping-and-payment" }) => {
|
|
746
746
|
const t = _(), { client: r } = I(), { data: n, isLoading: s, error: l } = Q({ queryKey: ["shippingAddress"], queryFn: async () => {
|
|
747
747
|
const { status: d, body: u } = await r.shipping.getShippingAddress();
|
|
748
748
|
if (d !== 200) throw new Error("Failed to fetch shipping address");
|
|
@@ -752,7 +752,7 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
752
752
|
};
|
|
753
753
|
return s ? e(dd, {}) : l ? i("div", { className: "p-4 rounded-lg bg-red-50 text-red-700", children: [e("p", { className: "font-semibold", children: "Failed to load shipping address" }), e("p", { className: "text-xs", children: "Please try refreshing the page or contact support if the issue persists." })] }) : i("div", { className: "flex flex-col gap-4 animate-fade-in", children: [i("div", { className: "flex flex-col gap-y-1", children: [e("h1", { className: "text-[32px] font-red-hat-display font-black dark:text-blue-500", children: "Shipping Details" }), e("p", { className: "text-gray-500", children: "Please fill in the your shipping details to continue." })] }), e(od, { initialData: n ?? null, onSuccess: o, shippingAndPaymentPageUrl: a }, n == null ? void 0 : n.id)] });
|
|
754
754
|
}, cd = () => i(C, { children: [e("div", { className: "animate-pulse space-y-4", children: e("div", { className: "space-y-2", children: [1, 2, 3].map((a) => i("div", { className: "flex items-center gap-3 p-4 border rounded-lg", children: [e("div", { className: "h-4 w-4 bg-gray-100 rounded-full" }), i("div", { className: "flex-1 space-y-2", children: [e("div", { className: "h-5 w-32 bg-gray-100 rounded-sm" }), e("div", { className: "h-4 w-24 bg-gray-100 rounded-sm" })] })] }, a)) }) }), e("div", { className: "animate-pulse space-y-4 mt-8", children: e("div", { className: "space-y-2", children: [1, 2].map((a) => i("div", { className: "flex items-center gap-3 p-4 border rounded-lg", children: [e("div", { className: "h-4 w-4 bg-gray-100 rounded-full" }), e("div", { className: "h-5 w-24 bg-gray-100 rounded-sm" })] }, a)) }) }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-4", children: [e("div", { className: "h-10 bg-gray-100 rounded-sm" }), e("div", { className: "h-10 bg-gray-100 rounded-sm" })] })] }), md = ({ shippingMethods: a, paymentMethods: t, customerDetailsPageUrl: r }) => {
|
|
755
|
-
const n = _(), { client: s, baseUrl: l } = I(), { organizationId: o } = Ne(), { items: d, shippingMethod: u, paymentMethod: c, setPaymentMethod: h, setShippingMethod: p } =
|
|
755
|
+
const n = _(), { client: s, baseUrl: l } = I(), { organizationId: o } = Ne(), { items: d, shippingMethod: u, paymentMethod: c, setPaymentMethod: h, setShippingMethod: p } = nr(), g = L({ mutationFn: async () => {
|
|
756
756
|
if (!u) throw new Error("Please select a shipping method");
|
|
757
757
|
if (!c) throw new Error("Please select a payment method");
|
|
758
758
|
const { body: f, status: w } = await s.order.createOrder({ params: { organizationId: o }, body: { items: d, shippingMethodId: u == null ? void 0 : u.id, fulfilmentMethod: "delivery", payment: { provider: c.provider, method: c.method }, checkoutBaseUrl: l } });
|
|
@@ -779,14 +779,14 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
779
779
|
return d;
|
|
780
780
|
} });
|
|
781
781
|
return l.error || s.error ? i("div", { className: "p-4 rounded-lg bg-red-50 text-red-700", children: [e("p", { className: "font-semibold", children: "Failed to load shipping methods" }), e("p", { className: "text-xs", children: "Please try refreshing the page or contact support if the issue persists." })] }) : l.isLoading || s.isLoading ? e(cd, {}) : e("div", { className: "flex flex-col gap-3 animate-fade-in", children: e(md, { shippingMethods: l.data ?? [], paymentMethods: o.data ?? [], customerDetailsPageUrl: a }) });
|
|
782
|
-
}, pd = (a) => gi({ baseURL: a, plugins: [pi(), hi()] }),
|
|
782
|
+
}, pd = (a) => gi({ baseURL: a, plugins: [pi(), hi()] }), In = Ce(void 0), hd = ({ children: a, baseURL: t }) => {
|
|
783
783
|
const r = ce(() => pd(t), [t]);
|
|
784
|
-
return e(
|
|
784
|
+
return e(In.Provider, { value: r, children: a });
|
|
785
785
|
}, Re = () => {
|
|
786
|
-
const a = ge(
|
|
786
|
+
const a = ge(In);
|
|
787
787
|
if (a === void 0) throw new Error("useAuth must be used within a AuthProvider");
|
|
788
788
|
return a;
|
|
789
|
-
}, gd = () => i(C, { children: [e("div", { className: "animate-pulse", children: [1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-white/10" }), i("div", { className: "pl-3 md:pl-5 flex-1", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-3/4 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-1/2 mb-2" }), e("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: e("div", { className: "h-3 bg-white/10 rounded-sm w-24 mb-2" }) }), e("div", { className: "text-white text-sm font-semibold whitespace-nowrap mt-2 sm:block hidden", children: e("div", { className: "h-4 bg-white/10 rounded-sm w-16" }) })] }), i("div", { className: "ml-auto pl-4 text-right sm:hidden", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-16 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-20" })] })] }, a)) }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 w-16 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-5 w-24 bg-white/10 rounded-sm animate-pulse" })] })] }),
|
|
789
|
+
}, gd = () => i(C, { children: [e("div", { className: "animate-pulse", children: [1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-white/10" }), i("div", { className: "pl-3 md:pl-5 flex-1", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-3/4 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-1/2 mb-2" }), e("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: e("div", { className: "h-3 bg-white/10 rounded-sm w-24 mb-2" }) }), e("div", { className: "text-white text-sm font-semibold whitespace-nowrap mt-2 sm:block hidden", children: e("div", { className: "h-4 bg-white/10 rounded-sm w-16" }) })] }), i("div", { className: "ml-auto pl-4 text-right sm:hidden", children: [e("div", { className: "h-4 bg-white/10 rounded-sm w-16 mb-2" }), e("div", { className: "h-3 bg-white/10 rounded-sm w-20" })] })] }, a)) }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-4 w-20 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-4 w-16 bg-white/10 rounded-sm animate-pulse ml-auto" })] }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 w-16 bg-white/10 rounded-sm animate-pulse" }), e("div", { className: "h-5 w-24 bg-white/10 rounded-sm animate-pulse" })] })] }), br = ({ loading: a = !1, items: t, total: r, subtotal: n, shipping: s, discount: l, currency: o }) => a ? e(gd, {}) : t.length === 0 ? e("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "text-center py-6", children: [e("p", { className: "text-white font-red-hat-display text-xl font-black mb-4", children: "Your shopping cart is empty. Add some products to get started." }), e(E, { href: "/", className: "text-white hover:text-white/80 underline text-sm", children: "View products" })] }) }) }) : i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: t.map(({ title: d, subtitle: u, image: c, price: h, unitPrice: p, quantity: g }, b) => e("div", { children: i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:min-w-32 h-10 sm:h-24 overflow-hidden rounded-lg", children: c != null && c.url ? e(ve, { width: 100, height: 100, src: c.url, alt: "", className: "w-full h-full object-cover" }) : e("div", { className: "bg-slate-100 w-full h-full flex items-center justify-center", children: e("span", { className: "text-slate-400 text-xs", children: "No image" }) }) }), i("div", { className: "pl-3 md:pl-5", children: [e("div", { className: "flex font-red-hat-display h4 text-white text-sm items-center", children: d }), u && u.map((f, w) => e("div", { className: "text-white text-xs opacity-50", children: f }, w)), i("div", { className: "text-white text-xs opacity-50 whitespace-nowrap sm:block hidden", children: ["Price: ", p, " | Quantity: x ", g] }), e("div", { className: "font-red-hat-display h4 text-white text-sm whitespace-nowrap mt-2 sm:block hidden", children: h })] }), i("div", { className: "ml-auto pl-4 text-right sm:hidden", children: [e("div", { className: "font-red-hat-display h4 text-white text-sm whitespace-nowrap", children: h }), i("div", { className: "text-white text-xs opacity-50 whitespace-nowrap", children: ["Quantity: ", g] })] })] }) }, b)) }), e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), typeof s == "number" && i("div", { className: "mt-3 flex items-center", children: [e("h2", { className: "text-xs xl:text-sm text-white opacity-40 font-red-hat-display", children: "Shipping" }), e("h3", { className: "text-xs xl:text-sm text-white opacity-40 ml-auto font-red-hat-display", children: we(s, o) })] }), i("div", { className: "mt-3 flex items-center", children: [e("h2", { className: "text-xs xl:text-sm text-white opacity-40 font-red-hat-display", children: "Subtotal" }), e("h3", { className: "text-xs xl:text-sm text-white opacity-40 ml-auto font-red-hat-display", children: we(n, o) })] }), l ? i("div", { className: "mt-3 flex items-center", children: [e("h2", { className: "text-xs xl:text-sm text-white opacity-40", children: "Discount" }), i("h3", { className: "text-xs xl:text-sm text-white opacity-40 ml-auto", children: ["- ", we(n, o)] })] }) : null, e("hr", { className: " md:flex opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("h2", { className: "text-sm xl:text-lg text-white font-black font-red-hat-display", children: "Total" }), e("h3", { className: "xl:text-lg text-white font-black font-red-hat-display", children: we(r, o) })] })] }), fd = () => i("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [i("div", { className: "flex items-center", children: [e("span", { children: e(Da, { className: "w-5 h-5 text-white" }) }), e("div", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 bg-gray-300 animate-pulse rounded-full" }), e("div", { className: "ml-2 bg-gray-300 animate-pulse h-5 xl:h-6 w-24 xl:w-28 rounded" })] }), i("div", { className: "flex items-center", children: [i("div", { className: "mr-6 flex items-center", children: [e("div", { className: "w-8 h-8 bg-gray-300 animate-pulse rounded-full mr-2" }), e("div", { className: "bg-gray-300 animate-pulse h-4 w-16 rounded" })] }), i("div", { className: "flex md:hidden items-center", children: [e("div", { className: "bg-gray-300 animate-pulse h-3 w-12 rounded mr-1.5" }), e(xi, { className: "w-5 h-5 text-gray-300" })] })] })] }), yd = () => {
|
|
790
790
|
const a = _(), { useSession: t, signOut: r } = Re(), { data: n } = t(), s = () => {
|
|
791
791
|
var d;
|
|
792
792
|
if (!((d = n == null ? void 0 : n.user) != null && d.name)) return "";
|
|
@@ -795,17 +795,17 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
795
795
|
}, l = async () => {
|
|
796
796
|
await r(), a.push("/account/sign-in");
|
|
797
797
|
};
|
|
798
|
-
return e("div", { className: "hidden md:block", children: i(Ra, { children: [e(Ba, { className: "flex items-center focus:outline-hidden group", children: n != null && n.user ? e("div", { className: "w-8 h-8 rounded-full overflow-hidden flex items-center justify-center bg-blue-500 text-white relative transition-transform duration-200 group-hover:scale-110 group-hover:ring-2 group-hover:ring-white/50 group-hover:ring-offset-1 group-hover:cursor-pointer", children: n.user.image ? e("img", { src: n.user.image, alt: n.user.name || "User", className: "w-full h-full object-cover" }) : e("span", { className: "font-medium text-sm", children: s() }) }) : i("div", { className: "flex items-center text-white group-hover:text-blue-300 transition-colors duration-200", children: [e(Xa, { className: "w-5 h-5 mr-1 group-hover:scale-110 transition-transform duration-200" }), e("span", { children: "Guest" })] }) }), e(Ma, { className: "w-52 min-w-52 p-0 py-1 data-[state=open]:animate-slideDownAndFade z-50", align: "end", sideOffset: 5, forceMount: !0, children: n != null && n.user ? i(C, { children: [i(E, { href: "/account", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(
|
|
798
|
+
return e("div", { className: "hidden md:block", children: i(Ra, { children: [e(Ba, { className: "flex items-center focus:outline-hidden group", children: n != null && n.user ? e("div", { className: "w-8 h-8 rounded-full overflow-hidden flex items-center justify-center bg-blue-500 text-white relative transition-transform duration-200 group-hover:scale-110 group-hover:ring-2 group-hover:ring-white/50 group-hover:ring-offset-1 group-hover:cursor-pointer", children: n.user.image ? e("img", { src: n.user.image, alt: n.user.name || "User", className: "w-full h-full object-cover" }) : e("span", { className: "font-medium text-sm", children: s() }) }) : i("div", { className: "flex items-center text-white group-hover:text-blue-300 transition-colors duration-200", children: [e(Xa, { className: "w-5 h-5 mr-1 group-hover:scale-110 transition-transform duration-200" }), e("span", { children: "Guest" })] }) }), e(Ma, { className: "w-52 min-w-52 p-0 py-1 data-[state=open]:animate-slideDownAndFade z-50", align: "end", sideOffset: 5, forceMount: !0, children: n != null && n.user ? i(C, { children: [i(E, { href: "/account", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(Rs, { className: "h-4 w-4" }), "My account"] }), i(E, { href: "/account/orders", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(ma, { className: "h-4 w-4" }), "Orders"] }), i(E, { href: "/account/reservations", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(ta, { className: "h-4 w-4" }), "Reservations"] }), i("button", { onClick: l, className: "flex w-full items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(Bs, { className: "h-4 w-4" }), "Logout"] })] }) : i(E, { href: "/account/sign-in", className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-100", children: [e(Xa, { className: "h-4 w-4" }), "Sign in"] }) })] }) });
|
|
799
799
|
}, Pa = ({ summary: a }) => {
|
|
800
800
|
const { organization: t, loading: r } = Ne(), [n, s] = F(!1);
|
|
801
801
|
if (r) return e(fd, {});
|
|
802
802
|
const l = (t == null ? void 0 : t.name) ?? "", o = t == null ? void 0 : t.logoFile, d = (t == null ? void 0 : t.configuration.defaultCurrency) ?? "USD";
|
|
803
|
-
return i(C, { children: [i("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [i(E, { href: "/", className: "flex items-center", children: [e("span", { children: e(Da, { className: "w-5 h-5 text-white" }) }), o ? e("span", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 overflow-hidden rounded-full", children: e(ve, { src: o.url, alt: l, className: "w-full h-full", width: 32, height: 32 }) }) : e("div", { className: "flex items-center justify-center w-8 h-8 bg-blue-500 rounded-full text-white text-sm uppercase font-semibold", children: e("span", { children: l.slice(0, 2) }) }), l ? e("span", { className: "xl:text-lg font-black text-white ml-2 font-red-hat-display", children: l }) : null] }), i("div", { className: "flex items-center", children: [e("div", { className: "mr-6", children: e(yd, {}) }), a && e("div", { className: "flex md:hidden", children: n ? e("button", { className: "flex items-center text-white mr-2 animate-fade", onClick: () => s(!1), children: e(mt, { className: "w-5 h-5" }) }, 1) : i("button", { className: "flex items-center text-white mr-2 animate-fade", onClick: () => s(!0), children: [e("span", { className: "text-xs text-white font-semibold mr-1.5", children: we(a.total, d) }), e(xi, { className: "w-5 h-5" })] }, 2) })] })] }), a && e(ed, { isOpen: n, onClose: () => s(!1), children: e(
|
|
804
|
-
},
|
|
803
|
+
return i(C, { children: [i("header", { className: "fixed flex justify-between px-2 md:px-6 py-4 md:py-12 z-50 bg-gray-900 md:bg-transparent w-full", children: [i(E, { href: "/", className: "flex items-center", children: [e("span", { children: e(Da, { className: "w-5 h-5 text-white" }) }), o ? e("span", { className: "ml-1.5 w-7 xl:w-8 h-7 xl:h-8 overflow-hidden rounded-full", children: e(ve, { src: o.url, alt: l, className: "w-full h-full", width: 32, height: 32 }) }) : e("div", { className: "flex items-center justify-center w-8 h-8 bg-blue-500 rounded-full text-white text-sm uppercase font-semibold", children: e("span", { children: l.slice(0, 2) }) }), l ? e("span", { className: "xl:text-lg font-black text-white ml-2 font-red-hat-display", children: l }) : null] }), i("div", { className: "flex items-center", children: [e("div", { className: "mr-6", children: e(yd, {}) }), a && e("div", { className: "flex md:hidden", children: n ? e("button", { className: "flex items-center text-white mr-2 animate-fade", onClick: () => s(!1), children: e(mt, { className: "w-5 h-5" }) }, 1) : i("button", { className: "flex items-center text-white mr-2 animate-fade", onClick: () => s(!0), children: [e("span", { className: "text-xs text-white font-semibold mr-1.5", children: we(a.total, d) }), e(xi, { className: "w-5 h-5" })] }, 2) })] })] }), a && e(ed, { isOpen: n, onClose: () => s(!1), children: e(br, { total: a.total, items: a.items, shipping: a.shipping, subtotal: a.subtotal, currency: d }) })] });
|
|
804
|
+
}, En = ({ children: a, description: t, title: r }) => i(C, { children: [e(Pa, {}), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 relative", children: e("div", { className: "absolute inset-0 z-0", children: e(ve, { src: "/images/15750.jpg", alt: "Authentication background", fill: !0, className: "object-cover brightness-50", priority: !0 }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "py-10 xl:py-24 md:my-auto animate-fade w-full md:max-w-[432px]", children: [(r || t) && i("div", { className: "mb-4 flex flex-col gap-y-1", children: [r && e("h1", { className: "text-[32px] font-red-hat-display font-black", children: r }), t && e("p", { className: "text-gray-500", children: t })] }), a] }) })] }) })] }), $r = ({ children: a }) => {
|
|
805
805
|
const { useSession: t } = Re(), r = _(), { data: n, isPending: s } = t();
|
|
806
806
|
return ee(() => {
|
|
807
807
|
if (!s && n) return r.push("/checkout/customer-details");
|
|
808
|
-
}, [n, s, r]), s ? e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: e("div", { className: "mb-4", children: e("div", { className: "storefront-primary-border animate-spin rounded-full h-18 w-18 border-b-2" }) }) }) : e(
|
|
808
|
+
}, [n, s, r]), s ? e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: e("div", { className: "mb-4", children: e("div", { className: "storefront-primary-border animate-spin rounded-full h-18 w-18 border-b-2" }) }) }) : e(En, { children: a });
|
|
809
809
|
}, Xe = ({ children: a }) => {
|
|
810
810
|
const { useSession: t } = Re(), r = _(), { data: n, isPending: s } = t();
|
|
811
811
|
return ee(() => {
|
|
@@ -814,8 +814,8 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
814
814
|
}, bd = { danger: "border-red-200 bg-red-50 text-red-700", info: "border-sky-200 bg-sky-50 text-sky-700", neutral: "border-stone-200 bg-stone-100 text-stone-700", success: "border-emerald-200 bg-emerald-50 text-emerald-700", warning: "border-amber-200 bg-amber-50 text-amber-700" }, Ze = (a, t = "Not available", r = "MMM d, yyyy") => {
|
|
815
815
|
if (!a) return t;
|
|
816
816
|
const n = new Date(a);
|
|
817
|
-
return
|
|
818
|
-
},
|
|
817
|
+
return ar(n) ? q(n, r) : t;
|
|
818
|
+
}, zn = (a) => {
|
|
819
819
|
switch (a) {
|
|
820
820
|
case "accepted":
|
|
821
821
|
return "Accepted";
|
|
@@ -830,7 +830,7 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
830
830
|
default:
|
|
831
831
|
return "Pending";
|
|
832
832
|
}
|
|
833
|
-
},
|
|
833
|
+
}, Dn = (a) => {
|
|
834
834
|
switch (a) {
|
|
835
835
|
case "accepted":
|
|
836
836
|
case "ready-for-dispatch":
|
|
@@ -843,17 +843,17 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
843
843
|
default:
|
|
844
844
|
return "warning";
|
|
845
845
|
}
|
|
846
|
-
},
|
|
846
|
+
}, Fn = (a) => a.cancelledAt ? "Cancelled" : a.acceptedAt ? "Confirmed" : "Pending", Rn = (a) => a.cancelledAt ? "danger" : a.acceptedAt ? "success" : "warning", xd = (a) => {
|
|
847
847
|
if (!a) return "A";
|
|
848
848
|
const t = a.split(" ").filter(Boolean);
|
|
849
849
|
return t.length === 0 ? "A" : t.length === 1 ? t[0].slice(0, 1).toUpperCase() : `${t[0].slice(0, 1)}${t[t.length - 1].slice(0, 1)}`.toUpperCase();
|
|
850
|
-
}, Et = ({ actions: a, children: t, description: r, eyebrow: n, title: s }) => i(C, { children: [e(Pa, {}), e("main", { className: "min-h-screen bg-[linear-gradient(180deg,#0f172a_0px,#0f172a_180px,#f5f1e8_180px,#faf7f2_100%)] pb-16 pt-28 sm:pt-32", children: e("div", { className: "mx-auto max-w-6xl px-4 sm:px-6 lg:px-8", children: i("div", { className: "overflow-hidden rounded-[32px] border border-stone-200 bg-white shadow-[0_24px_80px_rgba(15,23,42,0.12)]", children: [e("div", { className: "border-b border-stone-200 bg-[radial-gradient(circle_at_top_left,rgba(20,184,166,0.16),transparent_34%),linear-gradient(135deg,#fff7ed_0%,#ffffff_45%,#f8fafc_100%)] px-6 py-8 sm:px-8 lg:px-10", children: i("div", { className: "flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between", children: [i("div", { className: "max-w-2xl", children: [n ? e("p", { className: "mb-3 text-xs font-semibold uppercase tracking-[0.28em] text-stone-500", children: n }) : null, e("h1", { className: "font-red-hat-display text-3xl font-black text-stone-950 sm:text-[40px] sm:leading-tight", children: s }), r ? e("p", { className: "mt-3 max-w-xl text-sm leading-6 text-stone-600 sm:text-base", children: r }) : null] }), a ? e("div", { className: "flex flex-wrap gap-3 lg:justify-end", children: a }) : null] }) }), e("div", { className: "px-6 py-6 sm:px-8 sm:py-8 lg:px-10", children: t })] }) }) })] }), da = ({ action: a, children: t, className: r, description: n, title: s }) => i("section", { className: x("rounded-[28px] border border-stone-200 bg-stone-50/80 p-5 sm:p-6", r), children: [i("div", { className: "mb-5 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [e("h2", { className: "font-red-hat-display text-xl font-black text-stone-950", children: s }), n ? e("p", { className: "mt-1 text-sm leading-6 text-stone-600", children: n }) : null] }), a] }), t] }), rt = ({ children: a, className: t, tone: r = "neutral" }) => e("span", { className: x("inline-flex items-center rounded-full border px-3 py-1 text-xs font-semibold uppercase tracking-wide", bd[r], t), children: a }), He = ({ actionHref: a, actionLabel: t, description: r, icon: n, title: s }) => i("div", { className: "rounded-[24px] border border-dashed border-stone-300 bg-white px-6 py-10 text-center", children: [e("div", { className: "mx-auto flex h-14 w-14 items-center justify-center rounded-2xl bg-stone-100 text-stone-700", children: e(n, { className: "h-6 w-6" }) }), e("h3", { className: "mt-4 font-red-hat-display text-xl font-black text-stone-950", children: s }), e("p", { className: "mx-auto mt-2 max-w-md text-sm leading-6 text-stone-600", children: r }), a && t ? e("div", { className: "mt-5", children: e(Y, { asChild: !0, children: e(E, { href: a, children: t }) }) }) : null] }),
|
|
850
|
+
}, Et = ({ actions: a, children: t, description: r, eyebrow: n, title: s }) => i(C, { children: [e(Pa, {}), e("main", { className: "min-h-screen bg-[linear-gradient(180deg,#0f172a_0px,#0f172a_180px,#f5f1e8_180px,#faf7f2_100%)] pb-16 pt-28 sm:pt-32", children: e("div", { className: "mx-auto max-w-6xl px-4 sm:px-6 lg:px-8", children: i("div", { className: "overflow-hidden rounded-[32px] border border-stone-200 bg-white shadow-[0_24px_80px_rgba(15,23,42,0.12)]", children: [e("div", { className: "border-b border-stone-200 bg-[radial-gradient(circle_at_top_left,rgba(20,184,166,0.16),transparent_34%),linear-gradient(135deg,#fff7ed_0%,#ffffff_45%,#f8fafc_100%)] px-6 py-8 sm:px-8 lg:px-10", children: i("div", { className: "flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between", children: [i("div", { className: "max-w-2xl", children: [n ? e("p", { className: "mb-3 text-xs font-semibold uppercase tracking-[0.28em] text-stone-500", children: n }) : null, e("h1", { className: "font-red-hat-display text-3xl font-black text-stone-950 sm:text-[40px] sm:leading-tight", children: s }), r ? e("p", { className: "mt-3 max-w-xl text-sm leading-6 text-stone-600 sm:text-base", children: r }) : null] }), a ? e("div", { className: "flex flex-wrap gap-3 lg:justify-end", children: a }) : null] }) }), e("div", { className: "px-6 py-6 sm:px-8 sm:py-8 lg:px-10", children: t })] }) }) })] }), da = ({ action: a, children: t, className: r, description: n, title: s }) => i("section", { className: x("rounded-[28px] border border-stone-200 bg-stone-50/80 p-5 sm:p-6", r), children: [i("div", { className: "mb-5 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [e("h2", { className: "font-red-hat-display text-xl font-black text-stone-950", children: s }), n ? e("p", { className: "mt-1 text-sm leading-6 text-stone-600", children: n }) : null] }), a] }), t] }), rt = ({ children: a, className: t, tone: r = "neutral" }) => e("span", { className: x("inline-flex items-center rounded-full border px-3 py-1 text-xs font-semibold uppercase tracking-wide", bd[r], t), children: a }), He = ({ actionHref: a, actionLabel: t, description: r, icon: n, title: s }) => i("div", { className: "rounded-[24px] border border-dashed border-stone-300 bg-white px-6 py-10 text-center", children: [e("div", { className: "mx-auto flex h-14 w-14 items-center justify-center rounded-2xl bg-stone-100 text-stone-700", children: e(n, { className: "h-6 w-6" }) }), e("h3", { className: "mt-4 font-red-hat-display text-xl font-black text-stone-950", children: s }), e("p", { className: "mx-auto mt-2 max-w-md text-sm leading-6 text-stone-600", children: r }), a && t ? e("div", { className: "mt-5", children: e(Y, { asChild: !0, children: e(E, { href: a, children: t }) }) }) : null] }), xr = ({ description: a = "Loading your latest activity.", title: t }) => i(Et, { eyebrow: "My account", title: t, description: a, children: [e("div", { className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4", children: Array.from({ length: 4 }).map((r, n) => e("div", { className: "h-36 animate-pulse rounded-[24px] border border-stone-200 bg-stone-100" }, n)) }), i("div", { className: "mt-6 grid gap-6 lg:grid-cols-2", children: [e("div", { className: "h-80 animate-pulse rounded-[28px] border border-stone-200 bg-stone-100" }), e("div", { className: "h-80 animate-pulse rounded-[28px] border border-stone-200 bg-stone-100" })] })] }), it = ({ href: a, label: t }) => i(E, { href: a, className: "inline-flex items-center gap-1 text-sm font-semibold text-stone-700 transition hover:text-stone-950", children: [t, e(Ms, { className: "h-4 w-4" })] }), wd = (a) => {
|
|
851
851
|
const t = a.items.map((r) => {
|
|
852
852
|
var n;
|
|
853
853
|
return (n = r.translations[0]) == null ? void 0 : n.title;
|
|
854
854
|
}).filter(Boolean);
|
|
855
855
|
return t.length === 0 ? "Order placed" : t.length === 1 ? t[0] : `${t[0]} +${t.length - 1} more`;
|
|
856
|
-
},
|
|
856
|
+
}, Gr = ({ description: a, href: t, icon: r, title: n }) => i(E, { href: t, className: "storefront-primary-border-hover group rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: [e("p", { className: "text-xs font-semibold uppercase tracking-[0.22em] text-stone-500", children: "Quick access" }), i("div", { className: "mt-3 flex items-start justify-between gap-3", children: [i("div", { children: [e("h3", { className: "font-red-hat-display text-xl font-black text-stone-950", children: n }), e("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: a })] }), e("span", { className: "storefront-primary-group-accent inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl bg-stone-100 text-stone-700 transition", children: e(r, { className: "h-5 w-5" }) })] })] }), kd = () => {
|
|
857
857
|
var p, g, b;
|
|
858
858
|
const { client: a } = I(), { useSession: t } = Re(), { organization: r, organizationId: n } = Ne(), { data: s } = t(), l = Q({ queryKey: ["account", "orders", n], enabled: !!n && !!(s != null && s.user), queryFn: async () => {
|
|
859
859
|
const { body: f, status: w } = await a.order.getMyOrders({ params: { organizationId: n }, query: { limit: 4, page: 1 } });
|
|
@@ -865,31 +865,31 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
865
865
|
return f;
|
|
866
866
|
} });
|
|
867
867
|
if (!(s != null && s.user)) return null;
|
|
868
|
-
if (l.isLoading || o.isLoading) return e(
|
|
868
|
+
if (l.isLoading || o.isLoading) return e(xr, { title: "Your account" });
|
|
869
869
|
const d = ((p = l.data) == null ? void 0 : p.list) ?? [], u = ((g = o.data) == null ? void 0 : g.list) ?? [], c = [...u].filter((f) => !f.cancelledAt && !!f.date && new Date(f.date).getTime() > Date.now()).sort((f, w) => new Date(f.date ?? 0).getTime() - new Date(w.date ?? 0).getTime())[0], h = s.user.firstname ?? ((b = s.user.name) == null ? void 0 : b.split(" ").filter(Boolean)[0]) ?? "there";
|
|
870
|
-
return i(Et, { eyebrow: "My account", title: `Welcome back, ${h}`, description: "Track recent orders, revisit reservation history, and jump straight into the parts of your account you use most.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/orders", children: "View orders" }) }), e(Y, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: [i("div", { className: "grid gap-6 lg:grid-cols-[1.25fr_0.95fr]", children: [e(da, { title: "Recent orders", description: "A quick look at what you ordered most recently.", action: e(it, { href: "/account/orders", label: "See all" }), children: l.isError ? e(He, { icon: ma, title: "Orders unavailable", description: "We couldn't load your recent orders just now. Please refresh and try again." }) : d.length === 0 ? e(He, { icon: ma, title: "Your order history will appear here", description: "Once you place an order, you'll be able to track its progress and reopen the details from this account page.", actionHref: "/", actionLabel: "Browse the menu" }) : e("div", { className: "space-y-4", children: d.map((f) => e(E, { href: `/account/orders/${f.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: wd(f) }), e(rt, { tone:
|
|
871
|
-
}, vd = () => e(Xe, { children: e(kd, {}) }), Nd = { common: { cart: "Cart", checkout: "Checkout", products: "Products", home: "Home", search: "Search", loading: "Loading...", add: "Add", remove: "Remove", close: "Close", back: "Back", next: "Next", continue: "Continue", submit: "Submit", cancel: "Cancel", apply: "Apply", save: "Save", aboutUs: "About Us", ourStory: "Our Story", menu: "Menu", reservations: "Reservations", orderOnline: "Order Online", checkOurMenu: "Check Our Menu", privacyPolicy: "Privacy Policy", termsAndConditions: "Terms and Conditions", orderNow: "Order Now", makeReservation: "Make a Reservation" }, product: { addToCart: "Add to cart", outOfStock: "Out of stock", quantity: "Quantity", price: "Price", total: "Total", description: "Description", options: "Options", modifiers: "Modifiers" }, checkout: { yourOrder: "Your Order", orderSummary: "Order Summary", delivery: "Delivery", address: "Address", payment: "Payment", confirmation: "Confirmation", deliveryDetails: "Delivery Details", paymentMethod: "Payment Method", placeOrder: "Place Order", subtotal: "Subtotal", total: "Total" }, ourStory: { title: "Our Story", subtitle: "From the shores of South India to the heart of Poland – authentic flavors, unforgettable experiences", by: "By", paragraph1: "When Madras Bistro opened its doors in 2018, it marked a historic moment as Poland's first authentic South Indian restaurant. Our journey began with a simple yet profound vision: to introduce the rich, vibrant flavors of South India to the Polish culinary landscape.", paragraph2: "Our founders, inspired by their deep roots in Tamil Nadu, embarked on this venture after noticing that while North Indian cuisine had found its place in Poland, the diverse and distinctive flavors of South India remained undiscovered territory. They dreamed of creating a space where the aromatic spices, coconut-infused curries, and delicate dosas of their homeland could be experienced in their authentic form.", paragraph3: "The path wasn't always easy. Sourcing traditional ingredients, perfecting recipes that stayed true to their South Indian origins while appealing to Polish palates, and educating diners about a cuisine so different from what they knew – these were challenges we embraced with passion. Our chefs, trained in the time-honored techniques of South Indian cooking, worked tirelessly to ensure every dish that left our kitchen carried the essence of the regions they represented.", paragraph4: "Today, Madras Bistro stands as a cultural bridge between Poland and South India. We take pride in having introduced countless Polish diners to the joy of breaking a crispy dosa, savoring the complex flavors of a well-prepared sambar, and experiencing the unique combination of spices that makes South Indian cuisine so distinctive.", paragraph5: "Our story continues to unfold with each meal we serve, as we remain committed to our founding vision: bringing the authentic taste of South India to Poland, one delicious dish at a time.", paragraph6: "I warmly invite you to join us on this culinary adventure and discover the distinctive tastes of South India – a cuisine still new to many in Poland but certain to delight your palate with its rich traditions and bold flavors.", signature: "- Chef Victor", description: "Learn about Madras Bistro's journey in Krakow, bringing authentic South Indian cuisine with passion and tradition. Discover our story and culinary roots!" }, menuSection: { title: "Discover our menu", description: "Our menu is a collection of the most popular dishes from south india." }, orderOnline: { title: "Order Online", description: "Craving South Indian food? Order online from Madras Bistro in Krakow for delicious dosas, curries, and more. Fast, fresh, and authentic, delivered to you!" }, hero: { title: "Discover South Indian Cuisine that's Beyond Delicious", subtitle: "Embark on a flavorful journey rich in tradition and vibrant spices." }, introSection: { title: "Madras Bistro: Five Regions, One Extraordinary Table", paragraph1: "Step into a world where spices whisper ancient secrets and aromas tell tales of distant shores. At Madras Bistro, the diverse culinary heritage of South India comes alive on your plate—a gastronomic tapestry woven from the traditions of Tamil Nadu, Kerala, Andhra Pradesh, Karnataka, and Sri Lanka. Our kitchen celebrates this rich mosaic of regional cuisines, where coastal treasures meet inland specialties in a harmonious expression of flavor.", paragraph2: "In this tropical paradise, the climate nurtures abundant coconut groves and rice fields, giving birth to a culinary tradition that celebrates fresh ingredients and complex flavors. Unlike the heavy, cream-based dishes familiar to many, South Indian cuisine is a delicate dance of spices, featuring iconic dishes like crispy dosas, soft idlis, and tangy sambars that speak to centuries of culinary innovation. Each bite tells a story of coastal markets, family traditions, and a deep connection to the land." }, reservationSection: { title: "Reserve Your Table", description: "Experience authentic South Indian cuisine in a warm, inviting atmosphere. Make a reservation for a memorable dining experience." }, testimonialsSection: { title: "Google Reviews", description: "See what our customers are saying about us", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "A bistro worth visiting for fans of Indian flavors. They serve Indian cuisine and from the north of Sri Lanka. I ate delicious milk chicken with aromatic jeera rice. The bistro is small (3 tables) and modest, but you can listen to Indian music hits." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "My husband and I chanced upon this restaurant last Thursday whilst on a short break to Krakow from the UK. This small eatery with just 2 or 3 tables is run by the very friendly and obliging owner/chef and is conveniently located facing Ghetto Heroes Square. The Masala Uttapam, Masala Dosa, Kerala Chicken Curry, Chicken Roast and Masala Chai that we had were absolutely delicious. I highly recommend this restaurant to any lovers of South Indian food." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutely mouthwatering food! The owner (also the chef) is extremely passionate about the customers experience, and you can feel his expertise in every bite. Highly recommend the ghee dosa (he made it extra crispy for us on request). It tastes like home, is SO authentic. The only downside is that I'll miss the food terribly when I leave Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "If you're looking for a place that serves real Malabar food, this is definitely the spot. Highly recommended for anyone craving a taste of home!" }] }, orderTracking: { orderPlaced: "Order Placed", orderPlacedDesc: "Your order has been received and is waiting to be accepted", orderAccepted: "Order Accepted", orderAcceptedDesc: "Your order has been accepted and is being processed", readyForDispatch: "Ready for Dispatch", readyForDispatchDesc: "Your order is packed and ready to be shipped", orderDispatched: "Order Dispatched", orderDispatchedDesc: "Your order is on its way to you", orderDelivered: "Order Delivered", orderDeliveredDesc: "Your order has been delivered", orderCancelled: "Order Cancelled", orderCancelledDesc: "Your order has been cancelled", price: "Price", quantity: "Quantity", subtotal: "Subtotal", total: "Total", poweredBy: "Powered by", reference: "Reference", status: "Status" }, reservation: { reservationDetails: "Reservation Details", name: "Name", phone: "Phone", guests: "Guests", date: "Date", reference: "Reference", status: "Status", notSpecified: "Not specified", invalidDate: "Invalid date", requestSent: "Reservation Request Sent", requestSentDesc: "Your reservation request has been received and is waiting to be confirmed by the restaurant", confirmed: "Reservation Confirmed", confirmedDesc: "Your reservation has been confirmed", cancelled: "Reservation Cancelled", cancelledDesc: "Your reservation has been cancelled", pendingStatus: "Pending", confirmedStatus: "Confirmed", cancelledStatus: "Cancelled", poweredBy: "Powered by" }, homepage: { description: "Discover Madras Bistro, Krakow's first South Indian restaurant. Savor authentic flavors, vibrant spices, and traditional dishes in a cozy setting. Visit us today!" }, menu: { description: "Explore the Madras Bistro menu featuring authentic South Indian dishes like dosas, curries, and biryanis. Fresh ingredients, bold flavors in Krakow!" }, privacyPolicy: { description: "Read Madras Bistro's Privacy Policy to understand how we protect your data and ensure a secure experience while enjoying our South Indian cuisine in Krakow." }, termsAndConditions: { description: "Review the Terms and Conditions for using Madras Bistro's website and services in Krakow. Learn about our policies for online orders and dining." } }, Ad = { common: { cart: "Koszyk", checkout: "Zamówienie", products: "Produkty", home: "Strona główna", search: "Szukaj", loading: "Ładowanie...", add: "Dodaj", remove: "Usuń", close: "Zamknij", back: "Wstecz", next: "Dalej", continue: "Kontynuuj", submit: "Wyślij", cancel: "Anuluj", apply: "Zastosuj", save: "Zapisz", aboutUs: "O nas", ourStory: "O Nas", menu: "Menu", reservations: "Rezerwacje", orderOnline: "Zamów online", checkOurMenu: "Sprawdź nasze menu", privacyPolicy: "Polityka prywatności", termsAndConditions: "Warunki korzystania", orderNow: "Zamów teraz", makeReservation: "Zarezerwuj stolik" }, product: { addToCart: "Dodaj do koszyka", outOfStock: "Brak w magazynie", quantity: "Ilość", price: "Cena", total: "Razem", description: "Opis", options: "Opcje", modifiers: "Modyfikatory" }, checkout: { yourOrder: "Twoje zamówienie", orderSummary: "Podsumowanie zamówienia", delivery: "Dostawa", address: "Adres", payment: "Płatność", confirmation: "Potwierdzenie", deliveryDetails: "Szczegóły dostawy", paymentMethod: "Metoda płatności", placeOrder: "Złóż zamówienie", subtotal: "Suma częściowa", total: "Razem" }, ourStory: { title: "Nasza historia", subtitle: "Z wybrzeży Południowych Indii do serca Polski – autentyczne smaki, niezapomniane doświadczenia", by: "Autor", paragraph1: "Kiedy Madras Bistro otworzyło swoje drzwi w 2018 roku, był to historyczny moment jako pierwsza autentyczna restauracja południowoindyjska w Polsce. Nasza podróż rozpoczęła się od prostej, ale głębokiej wizji: wprowadzenia bogatych, żywych smaków Południowych Indii do polskiego krajobrazu kulinarnego.", paragraph2: "Nasi założyciele, zainspirowani swoimi głębokimi korzeniami w Tamil Nadu, rozpoczęli tę przygodę po zauważeniu, że podczas gdy kuchnia północnoindyjska znalazła swoje miejsce w Polsce, różnorodne i charakterystyczne smaki Południowych Indii pozostały nieodkrytym terytorium. Marzyli o stworzeniu miejsca, gdzie aromatyczne przyprawy, curry nasycone kokosem i delikatne dosa z ich ojczyzny mogłyby być doświadczane w autentycznej formie.", paragraph3: "Droga nie zawsze była łatwa. Pozyskiwanie tradycyjnych składników, doskonalenie przepisów, które pozostały wierne południowoindyjskim korzeniom, a jednocześnie trafiały w gusta polskich podniebień, oraz edukowanie gości o kuchni tak różnej od tego, co znali – to były wyzwania, które przyjęliśmy z pasją. Nasi szefowie kuchni, wyszkoleni w tradycyjnych technikach gotowania południowoindyjskiego, pracowali niestrudzenie, aby zapewnić, że każde danie opuszczające naszą kuchnię niosło w sobie esencję regionów, które reprezentowali.", paragraph4: "Dziś Madras Bistro stoi jako kulturowy most między Polską a Południowymi Indiami. Jesteśmy dumni z tego, że wprowadziliśmy niezliczonych polskich gości w radość przełamywania chrupiącej dosy, smakowania złożonych smaków dobrze przygotowanego sambaru i doświadczania unikalnej kombinacji przypraw, która sprawia, że kuchnia południowoindyjska jest tak wyjątkowa.", paragraph5: "Nasza historia nadal rozwija się z każdym posiłkiem, który serwujemy, ponieważ pozostajemy wierni naszej wizji założycielskiej: przywiezienia autentycznego smaku Południowych Indii do Polski, jedno pyszne danie na raz.", paragraph6: "Serdecznie zapraszam do przyłączenia się do tej kulinarnej przygody i odkrycia charakterystycznych smaków Południowych Indii – kuchni nadal nowej dla wielu w Polsce, ale z pewnością zachwycającej podniebienie bogatymi tradycjami i wyrazistymi smakami.", signature: "- Szef kuchni Victor", description: "Poznaj historię Madras Bistro w Krakowie, które wprowadza autentyczną kuchnię południowoindyjską z pasją i tradycją. Odkryj naszą historię i kulinarne korzenie!" }, menuSection: { title: "Odkryj nasze menu", description: "Nasze menu to kolekcja najpopularniejszych dań z południowych Indii." }, orderOnline: { title: "Zamów online", description: "Masz ochotę na południowoindyjskie jedzenie? Zamów online z Madras Bistro w Krakowie pyszne dosa, curry i więcej. Szybkie, świeże i autentyczne, dostarczone prosto do Ciebie!" }, hero: { title: "Odkryj przepyszną południowo indyjską kuchnie", subtitle: "Wyrusz w pełną smaków podróż bogatą w tradycję i wyraziste przyprawy." }, introSection: { title: "Madras Bistro: Pięć regionów, jeden wyjątkowy stół", paragraph1: "Wejdź do świata, gdzie przyprawy szepczą dawne sekrety, a aromaty opowiadają historie z dalekich brzegów. W Madras Bistro różnorodne dziedzictwo kulinarne Południowych Indii ożywa na Twoim talerzu — gastronomiczna tkanina utkana z tradycji Tamil Nadu, Kerali, Andhra Pradesh, Karnataki i Sri Lanki. Nasza kuchnia celebruje tę bogatą mozaikę regionalnych kuchni, gdzie nadmorskie skarby spotykają się z wewnątrznymi specjałami w harmonijnym wyrażeniu smaku.", paragraph2: "W tym tropikalnym raju klimat sprzyja obfitym palmom kokosowym i polom ryżowym, dając początek tradycji kulinarnej, która celebruje świeże składniki i złożone smaki. W przeciwieństwie do ciężkich, kremowych dań znanych wielu osobom, kuchnia południowoindyjska to delikatny taniec przypraw, z takimi ikonicznymi daniami jak chrupiące dosy, miękkie idli i pikantne sambary, które mówią o wiekach kulinarnych innowacji. Każdy kęs opowiada historię nadmorskich targów, rodzinnych tradycji i głębokiego związku z ziemią." }, reservationSection: { title: "Zarezerwuj stolik", description: "Doświadcz autentycznej kuchni południowoindyjskiej w ciepłej, przyjaznej atmosferze. Dokonaj rezerwacji na niezapomniane doświadczenie kulinarne." }, testimonialsSection: { title: "Opinie Google", description: "Zobacz, co mówią o nas nasi klienci", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "Bistro warte odwiedzenia dla fanów indyjskich smaków. Serwują kuchnię indyjską i z północy Sri Lanki. Zjadłem pysznego kurczaka w mleku z aromatycznym ryżem jeera. Bistro jest małe (3 stoliki) i skromne, ale można posłuchać indyjskich hitów muzycznych." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "Ja i mój mąż przypadkowo trafiliśmy do tej restauracji w zeszły czwartek podczas krótkiego pobytu w Krakowie z Wielkiej Brytanii. Ta mała jadłodajnia z zaledwie 2 lub 3 stolikami jest prowadzona przez bardzo przyjaznego i uczynnego właściciela/szefa kuchni i jest dogodnie zlokalizowana naprzeciwko Placu Bohaterów Getta. Masala Uttapam, Masala Dosa, Curry z Kurczakiem Kerala, Kurczak Pieczony i Masala Chai, które jedliśmy, były absolutnie pyszne. Gorąco polecam tę restaurację wszystkim miłośnikom południowo-indyjskiej kuchni." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutnie pyszne jedzenie! Właściciel (również szef kuchni) jest niezwykle zaangażowany w doświadczenia klientów i można poczuć jego doświadczenie w każdym kęsie. Gorąco polecam ghee dosa (zrobił je dla nas ekstra chrupiące na prośbę). Smakuje jak w domu, jest BARDZO autentyczne. Jedynym minusem jest to, że będę tęsknić za tym jedzeniem, gdy opuszczę Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "Jeśli szukasz miejsca, które serwuje prawdziwe jedzenie Malabar, to zdecydowanie jest to odpowiednie miejsce. Gorąco polecane dla każdego, kto tęskni za smakiem domu!" }] }, orderTracking: { orderPlaced: "Zamówienie złożone", orderPlacedDesc: "Twoje zamówienie zostało odebrane i czeka na akceptację", orderAccepted: "Zamówienie zaakceptowane", orderAcceptedDesc: "Twoje zamówienie zostało zaakceptowane i jest przetwarzane", readyForDispatch: "Gotowe do wysyłki", readyForDispatchDesc: "Twoje zamówienie jest spakowane i gotowe do wysyłki", orderDispatched: "Zamówienie wysłane", orderDispatchedDesc: "Twoje zamówienie jest w drodze do Ciebie", orderDelivered: "Zamówienie dostarczone", orderDeliveredDesc: "Twoje zamówienie zostało dostarczone", orderCancelled: "Zamówienie anulowane", orderCancelledDesc: "Twoje zamówienie zostało anulowane", price: "Cena", quantity: "Ilość", subtotal: "Suma częściowa", total: "Razem", poweredBy: "Wspierane przez", reference: "Numer referencyjny", status: "Status" }, reservation: { reservationDetails: "Szczegóły rezerwacji", name: "Imię i nazwisko", phone: "Telefon", guests: "Liczba gości", date: "Data", reference: "Numer referencyjny", status: "Status", notSpecified: "Nie określono", invalidDate: "Nieprawidłowa data", requestSent: "Prośba o rezerwację wysłana", requestSentDesc: "Twoja prośba o rezerwację została odebrana i czeka na potwierdzenie przez restaurację", confirmed: "Rezerwacja potwierdzona", confirmedDesc: "Twoja rezerwacja została potwierdzona", cancelled: "Rezerwacja anulowana", cancelledDesc: "Twoja rezerwacja została anulowana", pendingStatus: "Oczekujące", confirmedStatus: "Potwierdzone", cancelledStatus: "Anulowane", poweredBy: "Wspierane przez" }, homepage: { description: "Odkryj Madras Bistro, pierwszą restaurację południowoindyjską w Krakowie. Skosztuj autentycznych smaków, żywych przypraw i tradycyjnych dań w przytulnym otoczeniu. Odwiedź nas już dziś!" }, menu: { description: "Zapoznaj się z menu Madras Bistro oferującym autentyczne południowoindyjskie dania jak dosa, curry i biryani. Świeże składniki, wyraziste smaki w Krakowie!" }, privacyPolicy: { description: "Przeczytaj Politykę Prywatności Madras Bistro, aby zrozumieć, jak chronimy Twoje dane i zapewniamy bezpieczne doświadczenie podczas delektowania się naszą południowoindyjską kuchnią w Krakowie." }, termsAndConditions: { description: "Zapoznaj się z Warunkami korzystania ze strony internetowej i usług Madras Bistro w Krakowie. Dowiedz się o naszych zasadach dotyczących zamówień online i dań w restauracji." } }, Gr = { en: Nd, pl: Ad }, Mn = Ce(void 0), Cd = ({ children: a, locale: t }) => {
|
|
870
|
+
return i(Et, { eyebrow: "My account", title: `Welcome back, ${h}`, description: "Track recent orders, revisit reservation history, and jump straight into the parts of your account you use most.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/orders", children: "View orders" }) }), e(Y, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: [i("div", { className: "grid gap-6 lg:grid-cols-[1.25fr_0.95fr]", children: [e(da, { title: "Recent orders", description: "A quick look at what you ordered most recently.", action: e(it, { href: "/account/orders", label: "See all" }), children: l.isError ? e(He, { icon: ma, title: "Orders unavailable", description: "We couldn't load your recent orders just now. Please refresh and try again." }) : d.length === 0 ? e(He, { icon: ma, title: "Your order history will appear here", description: "Once you place an order, you'll be able to track its progress and reopen the details from this account page.", actionHref: "/", actionLabel: "Browse the menu" }) : e("div", { className: "space-y-4", children: d.map((f) => e(E, { href: `/account/orders/${f.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: wd(f) }), e(rt, { tone: Dn(f.status), children: zn(f.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.items.length, " item", f.items.length === 1 ? "" : "s", " •", " ", f.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] })] }), i("div", { className: "text-left sm:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: we(f.payment.total, f.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Ze(f.createdAt, "Recently") })] })] }) }, f.id)) }) }), i("div", { className: "grid gap-6", children: [e(da, { title: "Jump into your history", description: "The two most useful places for signed-in guests.", children: i("div", { className: "grid gap-4", children: [e(Gr, { href: "/account/orders", icon: ma, title: "Orders list", description: "Review every purchase, total paid, fulfilment method, and live order status." }), e(Gr, { href: "/account/reservations", icon: ta, title: "Reservation history", description: "See confirmed, pending, and cancelled bookings in one place." })] }) }), e(da, { title: "Profile snapshot", description: "A quick summary of the details tied to this account.", children: i("div", { className: "rounded-[24px] border border-stone-200 bg-white p-5", children: [i("div", { className: "flex items-center gap-4", children: [e("div", { className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-stone-900 text-lg font-black text-white", children: xd(s.user.name) }), i("div", { children: [e("p", { className: "font-red-hat-display text-lg font-black text-stone-950", children: s.user.name }), e("p", { className: "text-sm text-stone-500", children: s.user.email })] })] }), i("div", { className: "mt-5 grid gap-3 rounded-[20px] bg-stone-50 p-4 text-sm text-stone-600", children: [i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(Xa, { className: "h-4 w-4" }), "First name"] }), e("span", { className: "font-semibold text-stone-900", children: s.user.firstname })] }), i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(Xa, { className: "h-4 w-4" }), "Last name"] }), e("span", { className: "font-semibold text-stone-900", children: s.user.lastname })] }), i("div", { className: "flex items-center justify-between gap-3", children: [i("span", { className: "inline-flex items-center gap-2", children: [e(ta, { className: "h-4 w-4" }), "Upcoming reservation"] }), e("span", { className: "font-semibold text-stone-900", children: c ? Ze(c.date, "Not scheduled", "MMM d, yyyy") : "Nothing booked" })] })] }), e("div", { className: "mt-5", children: e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/reservations/book", children: "Book a table" }) }) })] }) })] })] }), e("div", { className: "mt-6", children: e(da, { title: "Reservation activity", description: "Your most recent table bookings and their current status.", action: i("div", { className: "flex flex-wrap gap-3", children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account/reservations/book", children: "Book a table" }) }), e(it, { href: "/account/reservations", label: "Open history" })] }), children: o.isError ? e(He, { icon: ta, title: "Reservations unavailable", description: "We couldn't load your reservation history just now. Please refresh and try again." }) : u.length === 0 ? e(He, { icon: ta, title: "No reservations yet", description: "When you reserve a table, the details and status updates will show up here.", actionHref: "/account/reservations/book", actionLabel: "Book a table" }) : e("div", { className: "grid gap-4 md:grid-cols-2", children: u.map((f) => e(E, { href: `/account/reservations/${f.id}`, className: "storefront-primary-border-hover group rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex items-start justify-between gap-3", children: [i("div", { children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Ze(f.date, "Date pending", "MMM d, yyyy") }), e(rt, { tone: Rn(f), children: Fn(f) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", f.referenceId, " • ", f.guests, " ", "guest", f.guests === 1 ? "" : "s"] })] }), e("p", { className: "text-sm font-medium text-stone-500", children: Ze(f.date, "Awaiting confirmation", "h:mm a") })] }) }, f.id)) }) }) })] });
|
|
871
|
+
}, vd = () => e(Xe, { children: e(kd, {}) }), Nd = { common: { cart: "Cart", checkout: "Checkout", products: "Products", home: "Home", search: "Search", loading: "Loading...", add: "Add", remove: "Remove", close: "Close", back: "Back", next: "Next", continue: "Continue", submit: "Submit", cancel: "Cancel", apply: "Apply", save: "Save", aboutUs: "About Us", ourStory: "Our Story", menu: "Menu", reservations: "Reservations", orderOnline: "Order Online", checkOurMenu: "Check Our Menu", privacyPolicy: "Privacy Policy", termsAndConditions: "Terms and Conditions", orderNow: "Order Now", makeReservation: "Make a Reservation" }, product: { addToCart: "Add to cart", outOfStock: "Out of stock", quantity: "Quantity", price: "Price", total: "Total", description: "Description", options: "Options", modifiers: "Modifiers" }, checkout: { yourOrder: "Your Order", orderSummary: "Order Summary", delivery: "Delivery", address: "Address", payment: "Payment", confirmation: "Confirmation", deliveryDetails: "Delivery Details", paymentMethod: "Payment Method", placeOrder: "Place Order", subtotal: "Subtotal", total: "Total" }, ourStory: { title: "Our Story", subtitle: "From the shores of South India to the heart of Poland – authentic flavors, unforgettable experiences", by: "By", paragraph1: "When Madras Bistro opened its doors in 2018, it marked a historic moment as Poland's first authentic South Indian restaurant. Our journey began with a simple yet profound vision: to introduce the rich, vibrant flavors of South India to the Polish culinary landscape.", paragraph2: "Our founders, inspired by their deep roots in Tamil Nadu, embarked on this venture after noticing that while North Indian cuisine had found its place in Poland, the diverse and distinctive flavors of South India remained undiscovered territory. They dreamed of creating a space where the aromatic spices, coconut-infused curries, and delicate dosas of their homeland could be experienced in their authentic form.", paragraph3: "The path wasn't always easy. Sourcing traditional ingredients, perfecting recipes that stayed true to their South Indian origins while appealing to Polish palates, and educating diners about a cuisine so different from what they knew – these were challenges we embraced with passion. Our chefs, trained in the time-honored techniques of South Indian cooking, worked tirelessly to ensure every dish that left our kitchen carried the essence of the regions they represented.", paragraph4: "Today, Madras Bistro stands as a cultural bridge between Poland and South India. We take pride in having introduced countless Polish diners to the joy of breaking a crispy dosa, savoring the complex flavors of a well-prepared sambar, and experiencing the unique combination of spices that makes South Indian cuisine so distinctive.", paragraph5: "Our story continues to unfold with each meal we serve, as we remain committed to our founding vision: bringing the authentic taste of South India to Poland, one delicious dish at a time.", paragraph6: "I warmly invite you to join us on this culinary adventure and discover the distinctive tastes of South India – a cuisine still new to many in Poland but certain to delight your palate with its rich traditions and bold flavors.", signature: "- Chef Victor", description: "Learn about Madras Bistro's journey in Krakow, bringing authentic South Indian cuisine with passion and tradition. Discover our story and culinary roots!" }, menuSection: { title: "Discover our menu", description: "Our menu is a collection of the most popular dishes from south india." }, orderOnline: { title: "Order Online", description: "Craving South Indian food? Order online from Madras Bistro in Krakow for delicious dosas, curries, and more. Fast, fresh, and authentic, delivered to you!" }, hero: { title: "Discover South Indian Cuisine that's Beyond Delicious", subtitle: "Embark on a flavorful journey rich in tradition and vibrant spices." }, introSection: { title: "Madras Bistro: Five Regions, One Extraordinary Table", paragraph1: "Step into a world where spices whisper ancient secrets and aromas tell tales of distant shores. At Madras Bistro, the diverse culinary heritage of South India comes alive on your plate—a gastronomic tapestry woven from the traditions of Tamil Nadu, Kerala, Andhra Pradesh, Karnataka, and Sri Lanka. Our kitchen celebrates this rich mosaic of regional cuisines, where coastal treasures meet inland specialties in a harmonious expression of flavor.", paragraph2: "In this tropical paradise, the climate nurtures abundant coconut groves and rice fields, giving birth to a culinary tradition that celebrates fresh ingredients and complex flavors. Unlike the heavy, cream-based dishes familiar to many, South Indian cuisine is a delicate dance of spices, featuring iconic dishes like crispy dosas, soft idlis, and tangy sambars that speak to centuries of culinary innovation. Each bite tells a story of coastal markets, family traditions, and a deep connection to the land." }, reservationSection: { title: "Reserve Your Table", description: "Experience authentic South Indian cuisine in a warm, inviting atmosphere. Make a reservation for a memorable dining experience." }, testimonialsSection: { title: "Google Reviews", description: "See what our customers are saying about us", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "A bistro worth visiting for fans of Indian flavors. They serve Indian cuisine and from the north of Sri Lanka. I ate delicious milk chicken with aromatic jeera rice. The bistro is small (3 tables) and modest, but you can listen to Indian music hits." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "My husband and I chanced upon this restaurant last Thursday whilst on a short break to Krakow from the UK. This small eatery with just 2 or 3 tables is run by the very friendly and obliging owner/chef and is conveniently located facing Ghetto Heroes Square. The Masala Uttapam, Masala Dosa, Kerala Chicken Curry, Chicken Roast and Masala Chai that we had were absolutely delicious. I highly recommend this restaurant to any lovers of South Indian food." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutely mouthwatering food! The owner (also the chef) is extremely passionate about the customers experience, and you can feel his expertise in every bite. Highly recommend the ghee dosa (he made it extra crispy for us on request). It tastes like home, is SO authentic. The only downside is that I'll miss the food terribly when I leave Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "If you're looking for a place that serves real Malabar food, this is definitely the spot. Highly recommended for anyone craving a taste of home!" }] }, orderTracking: { orderPlaced: "Order Placed", orderPlacedDesc: "Your order has been received and is waiting to be accepted", orderAccepted: "Order Accepted", orderAcceptedDesc: "Your order has been accepted and is being processed", readyForDispatch: "Ready for Dispatch", readyForDispatchDesc: "Your order is packed and ready to be shipped", orderDispatched: "Order Dispatched", orderDispatchedDesc: "Your order is on its way to you", orderDelivered: "Order Delivered", orderDeliveredDesc: "Your order has been delivered", orderCancelled: "Order Cancelled", orderCancelledDesc: "Your order has been cancelled", price: "Price", quantity: "Quantity", subtotal: "Subtotal", total: "Total", poweredBy: "Powered by", reference: "Reference", status: "Status" }, reservation: { reservationDetails: "Reservation Details", name: "Name", phone: "Phone", guests: "Guests", date: "Date", reference: "Reference", status: "Status", notSpecified: "Not specified", invalidDate: "Invalid date", requestSent: "Reservation Request Sent", requestSentDesc: "Your reservation request has been received and is waiting to be confirmed by the restaurant", confirmed: "Reservation Confirmed", confirmedDesc: "Your reservation has been confirmed", cancelled: "Reservation Cancelled", cancelledDesc: "Your reservation has been cancelled", pendingStatus: "Pending", confirmedStatus: "Confirmed", cancelledStatus: "Cancelled", poweredBy: "Powered by" }, homepage: { description: "Discover Madras Bistro, Krakow's first South Indian restaurant. Savor authentic flavors, vibrant spices, and traditional dishes in a cozy setting. Visit us today!" }, menu: { description: "Explore the Madras Bistro menu featuring authentic South Indian dishes like dosas, curries, and biryanis. Fresh ingredients, bold flavors in Krakow!" }, privacyPolicy: { description: "Read Madras Bistro's Privacy Policy to understand how we protect your data and ensure a secure experience while enjoying our South Indian cuisine in Krakow." }, termsAndConditions: { description: "Review the Terms and Conditions for using Madras Bistro's website and services in Krakow. Learn about our policies for online orders and dining." } }, Ad = { common: { cart: "Koszyk", checkout: "Zamówienie", products: "Produkty", home: "Strona główna", search: "Szukaj", loading: "Ładowanie...", add: "Dodaj", remove: "Usuń", close: "Zamknij", back: "Wstecz", next: "Dalej", continue: "Kontynuuj", submit: "Wyślij", cancel: "Anuluj", apply: "Zastosuj", save: "Zapisz", aboutUs: "O nas", ourStory: "O Nas", menu: "Menu", reservations: "Rezerwacje", orderOnline: "Zamów online", checkOurMenu: "Sprawdź nasze menu", privacyPolicy: "Polityka prywatności", termsAndConditions: "Warunki korzystania", orderNow: "Zamów teraz", makeReservation: "Zarezerwuj stolik" }, product: { addToCart: "Dodaj do koszyka", outOfStock: "Brak w magazynie", quantity: "Ilość", price: "Cena", total: "Razem", description: "Opis", options: "Opcje", modifiers: "Modyfikatory" }, checkout: { yourOrder: "Twoje zamówienie", orderSummary: "Podsumowanie zamówienia", delivery: "Dostawa", address: "Adres", payment: "Płatność", confirmation: "Potwierdzenie", deliveryDetails: "Szczegóły dostawy", paymentMethod: "Metoda płatności", placeOrder: "Złóż zamówienie", subtotal: "Suma częściowa", total: "Razem" }, ourStory: { title: "Nasza historia", subtitle: "Z wybrzeży Południowych Indii do serca Polski – autentyczne smaki, niezapomniane doświadczenia", by: "Autor", paragraph1: "Kiedy Madras Bistro otworzyło swoje drzwi w 2018 roku, był to historyczny moment jako pierwsza autentyczna restauracja południowoindyjska w Polsce. Nasza podróż rozpoczęła się od prostej, ale głębokiej wizji: wprowadzenia bogatych, żywych smaków Południowych Indii do polskiego krajobrazu kulinarnego.", paragraph2: "Nasi założyciele, zainspirowani swoimi głębokimi korzeniami w Tamil Nadu, rozpoczęli tę przygodę po zauważeniu, że podczas gdy kuchnia północnoindyjska znalazła swoje miejsce w Polsce, różnorodne i charakterystyczne smaki Południowych Indii pozostały nieodkrytym terytorium. Marzyli o stworzeniu miejsca, gdzie aromatyczne przyprawy, curry nasycone kokosem i delikatne dosa z ich ojczyzny mogłyby być doświadczane w autentycznej formie.", paragraph3: "Droga nie zawsze była łatwa. Pozyskiwanie tradycyjnych składników, doskonalenie przepisów, które pozostały wierne południowoindyjskim korzeniom, a jednocześnie trafiały w gusta polskich podniebień, oraz edukowanie gości o kuchni tak różnej od tego, co znali – to były wyzwania, które przyjęliśmy z pasją. Nasi szefowie kuchni, wyszkoleni w tradycyjnych technikach gotowania południowoindyjskiego, pracowali niestrudzenie, aby zapewnić, że każde danie opuszczające naszą kuchnię niosło w sobie esencję regionów, które reprezentowali.", paragraph4: "Dziś Madras Bistro stoi jako kulturowy most między Polską a Południowymi Indiami. Jesteśmy dumni z tego, że wprowadziliśmy niezliczonych polskich gości w radość przełamywania chrupiącej dosy, smakowania złożonych smaków dobrze przygotowanego sambaru i doświadczania unikalnej kombinacji przypraw, która sprawia, że kuchnia południowoindyjska jest tak wyjątkowa.", paragraph5: "Nasza historia nadal rozwija się z każdym posiłkiem, który serwujemy, ponieważ pozostajemy wierni naszej wizji założycielskiej: przywiezienia autentycznego smaku Południowych Indii do Polski, jedno pyszne danie na raz.", paragraph6: "Serdecznie zapraszam do przyłączenia się do tej kulinarnej przygody i odkrycia charakterystycznych smaków Południowych Indii – kuchni nadal nowej dla wielu w Polsce, ale z pewnością zachwycającej podniebienie bogatymi tradycjami i wyrazistymi smakami.", signature: "- Szef kuchni Victor", description: "Poznaj historię Madras Bistro w Krakowie, które wprowadza autentyczną kuchnię południowoindyjską z pasją i tradycją. Odkryj naszą historię i kulinarne korzenie!" }, menuSection: { title: "Odkryj nasze menu", description: "Nasze menu to kolekcja najpopularniejszych dań z południowych Indii." }, orderOnline: { title: "Zamów online", description: "Masz ochotę na południowoindyjskie jedzenie? Zamów online z Madras Bistro w Krakowie pyszne dosa, curry i więcej. Szybkie, świeże i autentyczne, dostarczone prosto do Ciebie!" }, hero: { title: "Odkryj przepyszną południowo indyjską kuchnie", subtitle: "Wyrusz w pełną smaków podróż bogatą w tradycję i wyraziste przyprawy." }, introSection: { title: "Madras Bistro: Pięć regionów, jeden wyjątkowy stół", paragraph1: "Wejdź do świata, gdzie przyprawy szepczą dawne sekrety, a aromaty opowiadają historie z dalekich brzegów. W Madras Bistro różnorodne dziedzictwo kulinarne Południowych Indii ożywa na Twoim talerzu — gastronomiczna tkanina utkana z tradycji Tamil Nadu, Kerali, Andhra Pradesh, Karnataki i Sri Lanki. Nasza kuchnia celebruje tę bogatą mozaikę regionalnych kuchni, gdzie nadmorskie skarby spotykają się z wewnątrznymi specjałami w harmonijnym wyrażeniu smaku.", paragraph2: "W tym tropikalnym raju klimat sprzyja obfitym palmom kokosowym i polom ryżowym, dając początek tradycji kulinarnej, która celebruje świeże składniki i złożone smaki. W przeciwieństwie do ciężkich, kremowych dań znanych wielu osobom, kuchnia południowoindyjska to delikatny taniec przypraw, z takimi ikonicznymi daniami jak chrupiące dosy, miękkie idli i pikantne sambary, które mówią o wiekach kulinarnych innowacji. Każdy kęs opowiada historię nadmorskich targów, rodzinnych tradycji i głębokiego związku z ziemią." }, reservationSection: { title: "Zarezerwuj stolik", description: "Doświadcz autentycznej kuchni południowoindyjskiej w ciepłej, przyjaznej atmosferze. Dokonaj rezerwacji na niezapomniane doświadczenie kulinarne." }, testimonialsSection: { title: "Opinie Google", description: "Zobacz, co mówią o nas nasi klienci", testimonials: [{ name: "Konrad Górski", company: "Appy.com", text: "Bistro warte odwiedzenia dla fanów indyjskich smaków. Serwują kuchnię indyjską i z północy Sri Lanki. Zjadłem pysznego kurczaka w mleku z aromatycznym ryżem jeera. Bistro jest małe (3 stoliki) i skromne, ale można posłuchać indyjskich hitów muzycznych." }, { name: "Sophia Mackney", company: "Nobi Bank", text: "Ja i mój mąż przypadkowo trafiliśmy do tej restauracji w zeszły czwartek podczas krótkiego pobytu w Krakowie z Wielkiej Brytanii. Ta mała jadłodajnia z zaledwie 2 lub 3 stolikami jest prowadzona przez bardzo przyjaznego i uczynnego właściciela/szefa kuchni i jest dogodnie zlokalizowana naprzeciwko Placu Bohaterów Getta. Masala Uttapam, Masala Dosa, Curry z Kurczakiem Kerala, Kurczak Pieczony i Masala Chai, które jedliśmy, były absolutnie pyszne. Gorąco polecam tę restaurację wszystkim miłośnikom południowo-indyjskiej kuchni." }, { name: "Sridevi Madbhavi", company: "Sync", text: "Absolutnie pyszne jedzenie! Właściciel (również szef kuchni) jest niezwykle zaangażowany w doświadczenia klientów i można poczuć jego doświadczenie w każdym kęsie. Gorąco polecam ghee dosa (zrobił je dla nas ekstra chrupiące na prośbę). Smakuje jak w domu, jest BARDZO autentyczne. Jedynym minusem jest to, że będę tęsknić za tym jedzeniem, gdy opuszczę Kraków!" }, { name: "Bijeesh KB", company: "Appicu", text: "Jeśli szukasz miejsca, które serwuje prawdziwe jedzenie Malabar, to zdecydowanie jest to odpowiednie miejsce. Gorąco polecane dla każdego, kto tęskni za smakiem domu!" }] }, orderTracking: { orderPlaced: "Zamówienie złożone", orderPlacedDesc: "Twoje zamówienie zostało odebrane i czeka na akceptację", orderAccepted: "Zamówienie zaakceptowane", orderAcceptedDesc: "Twoje zamówienie zostało zaakceptowane i jest przetwarzane", readyForDispatch: "Gotowe do wysyłki", readyForDispatchDesc: "Twoje zamówienie jest spakowane i gotowe do wysyłki", orderDispatched: "Zamówienie wysłane", orderDispatchedDesc: "Twoje zamówienie jest w drodze do Ciebie", orderDelivered: "Zamówienie dostarczone", orderDeliveredDesc: "Twoje zamówienie zostało dostarczone", orderCancelled: "Zamówienie anulowane", orderCancelledDesc: "Twoje zamówienie zostało anulowane", price: "Cena", quantity: "Ilość", subtotal: "Suma częściowa", total: "Razem", poweredBy: "Wspierane przez", reference: "Numer referencyjny", status: "Status" }, reservation: { reservationDetails: "Szczegóły rezerwacji", name: "Imię i nazwisko", phone: "Telefon", guests: "Liczba gości", date: "Data", reference: "Numer referencyjny", status: "Status", notSpecified: "Nie określono", invalidDate: "Nieprawidłowa data", requestSent: "Prośba o rezerwację wysłana", requestSentDesc: "Twoja prośba o rezerwację została odebrana i czeka na potwierdzenie przez restaurację", confirmed: "Rezerwacja potwierdzona", confirmedDesc: "Twoja rezerwacja została potwierdzona", cancelled: "Rezerwacja anulowana", cancelledDesc: "Twoja rezerwacja została anulowana", pendingStatus: "Oczekujące", confirmedStatus: "Potwierdzone", cancelledStatus: "Anulowane", poweredBy: "Wspierane przez" }, homepage: { description: "Odkryj Madras Bistro, pierwszą restaurację południowoindyjską w Krakowie. Skosztuj autentycznych smaków, żywych przypraw i tradycyjnych dań w przytulnym otoczeniu. Odwiedź nas już dziś!" }, menu: { description: "Zapoznaj się z menu Madras Bistro oferującym autentyczne południowoindyjskie dania jak dosa, curry i biryani. Świeże składniki, wyraziste smaki w Krakowie!" }, privacyPolicy: { description: "Przeczytaj Politykę Prywatności Madras Bistro, aby zrozumieć, jak chronimy Twoje dane i zapewniamy bezpieczne doświadczenie podczas delektowania się naszą południowoindyjską kuchnią w Krakowie." }, termsAndConditions: { description: "Zapoznaj się z Warunkami korzystania ze strony internetowej i usług Madras Bistro w Krakowie. Dowiedz się o naszych zasadach dotyczących zamówień online i dań w restauracji." } }, Kr = { en: Nd, pl: Ad }, Bn = Ce(void 0), Cd = ({ children: a, locale: t }) => {
|
|
872
872
|
const r = V((s) => {
|
|
873
873
|
const l = s.split(".");
|
|
874
|
-
let o =
|
|
874
|
+
let o = Kr[t];
|
|
875
875
|
for (const d of l) if (o && typeof o == "object" && d in o) o = o[d];
|
|
876
876
|
else return s;
|
|
877
877
|
return typeof o == "string" ? o : s;
|
|
878
|
-
}, [t]), n = { locale: t, translations:
|
|
879
|
-
return e(
|
|
880
|
-
},
|
|
881
|
-
const a = ge(
|
|
878
|
+
}, [t]), n = { locale: t, translations: Kr[t], t: r };
|
|
879
|
+
return e(Bn.Provider, { value: n, children: a });
|
|
880
|
+
}, Mn = () => {
|
|
881
|
+
const a = ge(Bn);
|
|
882
882
|
if (a === void 0) throw new Error("useTranslation must be used within a TranslationProvider");
|
|
883
883
|
return a;
|
|
884
|
-
},
|
|
884
|
+
}, Pn = () => e(C, { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: e("div", { className: "pl-6", children: i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [[1, 2].map((a) => i("div", { className: "flex items-center w-full mb-5 sm:mb-7", children: [e("div", { className: "w-14 sm:w-32 h-10 sm:h-24 overflow-hidden rounded-lg bg-gray-700 animate-pulse" }), i("div", { className: "pl-3 md:pl-5 w-full", children: [e("div", { className: "h-4 bg-gray-700 rounded-sm w-3/4 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-1/2 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-1/4 animate-pulse" })] })] }, a)), e("hr", { className: "opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-3 bg-gray-700 rounded-sm w-20 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 ml-auto animate-pulse" })] }), i("div", { className: "mt-3 flex items-center", children: [e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 animate-pulse" }), e("div", { className: "h-3 bg-gray-700 rounded-sm w-16 ml-auto animate-pulse" })] }), e("hr", { className: "opacity-10 my-4 sm:my-4" }), i("div", { className: "mt-4 flex justify-between", children: [e("div", { className: "h-5 bg-gray-700 rounded-sm w-16 animate-pulse" }), e("div", { className: "h-5 bg-gray-700 rounded-sm w-20 animate-pulse" })] })] }) }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px]", children: [e("div", { className: "h-8 bg-gray-200 rounded-sm w-64 mb-4 animate-pulse" }), i("div", { className: "mb-8", children: [e("div", { className: "h-4 bg-gray-200 rounded-sm w-48 mb-2 animate-pulse" }), e("div", { className: "h-4 bg-gray-200 rounded-sm w-40 animate-pulse" })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 h-full w-0.5 bg-gray-200" }), [1, 2, 3, 4, 5].map((a) => i("div", { className: "ml-9 mb-8 relative", children: [e("div", { className: "absolute -left-9 mt-1.5", children: e("div", { className: "h-8 w-8 rounded-full bg-gray-200 animate-pulse" }) }), e("div", { className: "h-5 bg-gray-200 rounded-sm w-40 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-200 rounded-sm w-64 mb-2 animate-pulse" }), e("div", { className: "h-3 bg-gray-200 rounded-sm w-24 animate-pulse" })] }, a))] }) })] }) })] }) }), Sd = ({ className: a }) => e("svg", { className: a, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), Id = ({ className: a }) => e("svg", { className: a, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) }), Ed = ({ className: a }) => i("svg", { "aria-hidden": "true", className: a, viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), Qn = ({ title: a, description: t, active: r, date: n, cancelled: s = !1, showConfetti: l = !1 }) => {
|
|
885
885
|
const o = (c) => {
|
|
886
886
|
if (!c) return null;
|
|
887
887
|
const h = new Date(c);
|
|
888
|
-
return
|
|
888
|
+
return ar(h) ? q(h, "MMM d, yyyy - h:mm a") : null;
|
|
889
889
|
}, d = !!n, u = r && !n;
|
|
890
|
-
return i("div", { className: "relative flex items-start gap-4 pb-8", children: [e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full shrink-0", children: i("div", { className: x("w-8 h-8 rounded-full flex items-center justify-center", { "bg-green-100 border-green-500 border-[3px]": d && !l, "bg-violet-100 border-violet-500 border-[3px]": d && l, "bg-white": !n, "border-gray-200 border-[3px]": !n && !r, "bg-red-100 border-red-500 border-[3px]": s }), children: [n && !l && !s && e(Sd, { className: "w-4 h-4 text-green-500" }), d && l && e(
|
|
890
|
+
return i("div", { className: "relative flex items-start gap-4 pb-8", children: [e("div", { className: "flex items-center justify-center w-8 h-8 rounded-full shrink-0", children: i("div", { className: x("w-8 h-8 rounded-full flex items-center justify-center", { "bg-green-100 border-green-500 border-[3px]": d && !l, "bg-violet-100 border-violet-500 border-[3px]": d && l, "bg-white": !n, "border-gray-200 border-[3px]": !n && !r, "bg-red-100 border-red-500 border-[3px]": s }), children: [n && !l && !s && e(Sd, { className: "w-4 h-4 text-green-500" }), d && l && e(Ps, { className: "w-4 h-4 text-violet-500" }), s && e(Id, { className: "w-4 h-4 text-red-500" }), u && e(Ed, { className: "text-gray-200 animate-spin dark:text-gray-600 fill-blue-600 w-full" })] }) }), i("div", { className: "flex-1", children: [e("h3", { className: x("font-black font-red-hat-display", { "text-red-500": s, "text-gray-900": d, "text-gray-500": !s && !d }), children: a }), e("p", { className: x("text-sm font-medium", { "text-red-500": s, "text-gray-600": d, "text-gray-400": !s && !d }), children: t }), o(n) && e("p", { className: "text-xs text-gray-400 mt-1", children: o(n) })] })] });
|
|
891
891
|
}, zd = ({ orderId: a }) => {
|
|
892
|
-
const { client: t } = I(), { organization: r, organizationId: n } = Ne(), s = fe(), l = _(), o = We(), { t: d } =
|
|
892
|
+
const { client: t } = I(), { organization: r, organizationId: n } = Ne(), s = fe(), l = _(), o = We(), { t: d } = Mn(), u = r == null ? void 0 : r.configuration.defaultCurrency;
|
|
893
893
|
ee(() => {
|
|
894
894
|
if ((s == null ? void 0 : s.get("clearCart")) === "true" && o) {
|
|
895
895
|
localStorage.removeItem("shophost-cart");
|
|
@@ -907,9 +907,9 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
907
907
|
if (w !== 200) throw new Error("Failed to fetch shipping address");
|
|
908
908
|
return y;
|
|
909
909
|
} }), g = ce(() => c ? c == null ? void 0 : c.items.map((w) => ({ title: w.translations[0].title, subtitle: [w.translations[0].subtitle], price: we(w.unitPrice, u ?? "USD"), unitPrice: we(w.unitPrice, u ?? "USD"), quantity: w.quantity, image: w.image })) : [], [c, u]);
|
|
910
|
-
if (!c || h) return e(
|
|
910
|
+
if (!c || h) return e(Pn, {});
|
|
911
911
|
const { status: b } = c, f = [{ title: d("orderTracking.orderPlaced"), description: d("orderTracking.orderPlacedDesc"), date: new Date(c.expiresAt), active: !1 }, { title: d("orderTracking.orderAccepted"), description: d("orderTracking.orderAcceptedDesc"), date: c.acceptedAt, active: !c.acceptedAt }, { title: d("orderTracking.readyForDispatch"), description: d("orderTracking.readyForDispatchDesc"), date: c.readyForDispatchAt, active: b === "accepted" }, { title: d("orderTracking.orderDispatched"), description: d("orderTracking.orderDispatchedDesc"), date: c.dispatchedAt, active: b === "ready-for-dispatch" }, { title: d("orderTracking.orderDelivered"), description: d("orderTracking.orderDeliveredDesc"), date: c.completedAt, active: b === "dispatched", showConfetti: !0 }];
|
|
912
|
-
return c.status === "cancelled" && f.push({ title: d("orderTracking.orderCancelled"), description: d("orderTracking.orderCancelledDesc"), date: c.cancelledAt, active: !!c.cancelledAt, cancelled: !0 }), i(C, { children: [e(Pa, { summary: { total: c.payment.total, subtotal: c.payment.subtotal, shipping: c.payment.shipping, items: g } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [e(
|
|
912
|
+
return c.status === "cancelled" && f.push({ title: d("orderTracking.orderCancelled"), description: d("orderTracking.orderCancelledDesc"), date: c.cancelledAt, active: !!c.cancelledAt, cancelled: !0 }), i(C, { children: [e(Pa, { summary: { total: c.payment.total, subtotal: c.payment.subtotal, shipping: c.payment.shipping, items: g } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [e(br, { items: g, total: c.payment.total, subtotal: c.payment.subtotal, shipping: c.payment.shipping, currency: u ?? "USD" }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: [d("orderTracking.poweredBy"), " ", e("a", { href: "https://shophost.io", className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px] pt-14 sm:pt-0", children: [e("h1", { className: "h3 mb-1 font-red-hat-display", children: d("checkout.yourOrder") }), i("div", { className: "mb-8", children: [i("p", { className: "text-sm font-medium text-gray-500", children: [d("orderTracking.reference"), ": ", c.referenceId] }), i("p", { className: "text-sm font-medium text-gray-500", children: [d("orderTracking.status"), ":", " ", e("span", { className: `capitalize font-semibold ${c.status === "cancelled" ? "text-red-600" : "text-green-600"}`, children: c.status })] })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 w-0.5 bg-gray-200", style: { height: `calc(100% - ${f.length > 1 ? "4rem" : "0rem"})` } }), f.map((w, y) => e(Qn, { ...w }, y))] }) })] }) })] }) })] });
|
|
913
913
|
}, Dd = (a) => {
|
|
914
914
|
const t = a.items.map((r) => {
|
|
915
915
|
var n;
|
|
@@ -924,9 +924,9 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
924
924
|
return d;
|
|
925
925
|
} });
|
|
926
926
|
if (!(n != null && n.user)) return null;
|
|
927
|
-
if (s.isLoading) return e(
|
|
927
|
+
if (s.isLoading) return e(xr, { title: "Your orders", description: "Loading your order history." });
|
|
928
928
|
const l = ((o = s.data) == null ? void 0 : o.list) ?? [];
|
|
929
|
-
return e(Et, { eyebrow: "My account", title: "Your orders", description: "Everything you've ordered lives here, including totals, fulfilment details, and live status updates.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(Y, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: e("div", { children: e(da, { title: "Order history", description: "Open any order to review the full tracker and line items.", action: e(it, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(He, { icon: ma, title: "We couldn't load your orders", description: "Please refresh the page and try again. Your order tracker will be back as soon as the connection recovers." }) : l.length === 0 ? e(He, { icon: ma, title: "No orders yet", description: "Once you buy something, this page becomes your personal record of what you ordered and how each order progressed.", actionHref: "/", actionLabel: "Start shopping" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/orders/${d.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Dd(d) }), e(rt, { tone:
|
|
929
|
+
return e(Et, { eyebrow: "My account", title: "Your orders", description: "Everything you've ordered lives here, including totals, fulfilment details, and live status updates.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(Y, { asChild: !0, children: e(E, { href: "/account/reservations", children: "Reservation history" }) })] }), children: e("div", { children: e(da, { title: "Order history", description: "Open any order to review the full tracker and line items.", action: e(it, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(He, { icon: ma, title: "We couldn't load your orders", description: "Please refresh the page and try again. Your order tracker will be back as soon as the connection recovers." }) : l.length === 0 ? e(He, { icon: ma, title: "No orders yet", description: "Once you buy something, this page becomes your personal record of what you ordered and how each order progressed.", actionHref: "/", actionLabel: "Start shopping" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/orders/${d.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Dd(d) }), e(rt, { tone: Dn(d.status), children: zn(d.status) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", d.referenceId, " • ", d.items.length, " item", d.items.length === 1 ? "" : "s", " •", " ", d.fulfilmentMethod === "delivery" ? "Delivery" : "Pickup"] }), e("div", { className: "mt-4 flex flex-wrap gap-2", children: d.items.slice(0, 3).map((u, c) => {
|
|
930
930
|
var h;
|
|
931
931
|
return e("span", { className: "rounded-full border border-stone-200 bg-stone-50 px-3 py-1 text-xs font-medium text-stone-600", children: ((h = u.translations[0]) == null ? void 0 : h.title) ?? "Item" }, `${d.id}-${c}`);
|
|
932
932
|
}) })] }), i("div", { className: "shrink-0 text-left lg:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: we(d.payment.total, d.currency) }), e("p", { className: "mt-1 text-sm text-stone-500", children: Ze(d.createdAt, "Recently") }), e("p", { className: "mt-3 text-sm font-semibold text-stone-700 transition group-hover:text-stone-950", children: "View details" })] })] }) }, d.id)) }) }) }) });
|
|
@@ -941,13 +941,13 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
941
941
|
return e("div", { className: "flex flex-col gap-4", children: e(Ue, { ...s, children: i("form", { onSubmit: s.handleSubmit((o) => l.mutate(o)), children: [i("div", { className: "grid grid-cols-4 gap-x-4 gap-y-4 mt-3", children: [e(xe, { name: "firstname", label: "First Name", type: "text", className: "col-span-2", placeholder: "e.g. John" }), e(xe, { name: "lastname", label: "Last Name", type: "text", className: "col-span-2", placeholder: "e.g. Doe" }), e(xe, { name: "phone", label: "Phone", type: "phone-number", className: "col-span-4", placeholder: "e.g. +48 123 456 789" }), e(xe, { name: "guests", label: "Number of Guests", type: "number", className: "col-span-4", placeholder: "e.g. 2" }), e(xe, { name: "date", type: "week-time", className: "col-span-4 -mt-4" })] }), i("div", { className: "grid grid-cols-2 gap-x-2 w-full mt-8", children: [e(Y, { variant: "secondary", className: "shadow-none", type: "button", onClick: () => n.push("/"), children: "Back" }), e(Y, { type: "submit", className: "shadow-none", isLoading: l.isPending, loadingText: "Saving...", children: "Send Request" })] })] }) }) });
|
|
942
942
|
}, Bd = () => {
|
|
943
943
|
const { useSession: a } = Re(), { data: t } = a();
|
|
944
|
-
return t != null && t.user ? e(
|
|
945
|
-
},
|
|
944
|
+
return t != null && t.user ? e(En, { title: "Book a table", description: "Enter your details to book a table at Madras Bistro", children: e(Rd, { initialData: { firstname: t.user.firstname, lastname: t.user.lastname } }) }) : null;
|
|
945
|
+
}, Yr = (a, t) => {
|
|
946
946
|
if (!a) return t("reservation.notSpecified");
|
|
947
947
|
const r = new Date(a);
|
|
948
|
-
return
|
|
948
|
+
return ar(r) ? q(r, "MMM d, yyyy - h:mm a") : t("reservation.invalidDate");
|
|
949
949
|
}, Md = ({ reservationId: a }) => {
|
|
950
|
-
const { client: t } = I(), { organizationId: r } = Ne(), { t: n } =
|
|
950
|
+
const { client: t } = I(), { organizationId: r } = Ne(), { t: n } = Mn(), { data: s, isLoading: l } = Q({ queryKey: ["reservation", a], queryFn: async () => {
|
|
951
951
|
const { status: u, body: c } = await t.reservation.getReservation({ params: { reservationId: a, organizationId: r } });
|
|
952
952
|
if (u !== 200) throw new Error("Failed to fetch reservation");
|
|
953
953
|
return c;
|
|
@@ -955,11 +955,11 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
955
955
|
var c, h;
|
|
956
956
|
return !((c = u.data) != null && c.acceptedAt) && !((h = u.data) != null && h.cancelledAt) ? 30 * 1e3 : !1;
|
|
957
957
|
} });
|
|
958
|
-
if (!s || l) return e(
|
|
958
|
+
if (!s || l) return e(Pn, {});
|
|
959
959
|
const o = [{ title: n("reservation.requestSent"), description: n("reservation.requestSentDesc"), date: s.createdAt || /* @__PURE__ */ new Date(), active: !1 }, { title: n("reservation.confirmed"), description: n("reservation.confirmedDesc"), date: s.acceptedAt, active: !s.acceptedAt, showConfetti: !!s.acceptedAt }];
|
|
960
960
|
s.cancelledAt && o.push({ title: n("reservation.cancelled"), description: n("reservation.cancelledDesc"), date: s.cancelledAt, active: !1, cancelled: !0 });
|
|
961
961
|
const d = () => s.cancelledAt ? n("reservation.cancelledStatus") : s.acceptedAt ? n("reservation.confirmedStatus") : n("reservation.pendingStatus");
|
|
962
|
-
return i(C, { children: [e(Pa, {}), i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "flex flex-col w-full mb-5 sm:mb-3", children: [e("h2", { className: "text-xl font-bold text-white mb-2", children: n("reservation.reservationDetails") }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.date"), ":"] }), " ",
|
|
962
|
+
return i(C, { children: [e(Pa, {}), i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: e("div", { className: "w-96 animate-fade", children: i("div", { className: "pl-6", children: [i("div", { className: "px-7 pt-10 pb-0 md:pt-0 md:px-0", children: [e("div", { className: "my-3 sm:my-6 sm:pb-1", children: i("div", { className: "flex flex-col w-full mb-5 sm:mb-3", children: [e("h2", { className: "text-xl font-bold text-white mb-2", children: n("reservation.reservationDetails") }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-white font-medium text-sm mb-1", children: [i("span", { className: "opacity-70 font-semibold", children: [n("reservation.date"), ":"] }), " ", Yr(s.date, n)] })] }) }), e("hr", { className: "opacity-10 my-4 sm:my-4" }), e("div", { className: "mt-4", children: i("div", { className: "flex items-center", children: [e("h2", { className: "text-sm xl:text-lg text-white font-black font-red-hat-display", children: n("common.makeReservation") }), e("span", { className: `ml-auto py-1 px-3 rounded-full text-sm font-semibold ${s.cancelledAt ? "bg-red-100 text-red-800" : s.acceptedAt ? "bg-green-100 text-green-800" : "bg-yellow-100 text-yellow-800"}`, children: d() })] }) })] }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: [n("reservation.poweredBy"), " ", e("a", { href: "https://shophost.io", className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", children: "shophost.io" })] })] }) }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative animate-fade-in", children: i("div", { className: "md:my-auto animate-fade w-full md:max-w-[432px] pt-14 sm:pt-0", children: [e("h1", { className: "h3 mb-1 font-red-hat-display", children: n("common.makeReservation") }), i("div", { className: "mb-8", children: [i("p", { className: "text-sm font-medium text-gray-500", children: [n("reservation.reference"), ": ", s.referenceId] }), i("p", { className: "text-sm font-medium text-gray-500", children: [n("reservation.status"), ":", " ", e("span", { className: `capitalize font-semibold ${s.cancelledAt ? "text-red-600" : s.acceptedAt ? "text-green-600" : "text-yellow-600"}`, children: d() })] }), i("div", { className: "mt-10 border-b pb-6 md:hidden", children: [e("div", { className: "flex items-center", children: e("h2", { className: "text-lg font-black font-red-hat-display text-gray-900", children: n("reservation.reservationDetails") }) }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.name"), ":"] }), " ", s.firstname, " ", s.lastname] }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.phone"), ":"] }), " ", s.phone] }), i("p", { className: "text-sm text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.guests"), ":"] }), " ", s.guests] }), i("p", { className: "text-sm font-medium text-gray-600 mb-1", children: [i("span", { className: "font-semibold", children: [n("reservation.date"), ":"] }), " ", Yr(s.date, n)] })] })] }), e("div", { className: "mt-8 space-y-4", children: i("div", { className: "relative", children: [e("div", { className: "absolute left-4 top-0 w-0.5 bg-gray-200", style: { height: `calc(100% - ${o.length > 1 ? "4rem" : "0rem"})` } }), o.map((u, c) => e(Qn, { ...u }, c))] }) })] }) })] })] });
|
|
963
963
|
}, Pd = () => {
|
|
964
964
|
var o;
|
|
965
965
|
const { client: a } = I(), { useSession: t } = Re(), { organizationId: r } = Ne(), { data: n } = t(), s = Q({ queryKey: ["account", "reservations", "history", r], enabled: !!r && !!(n != null && n.user), queryFn: async () => {
|
|
@@ -968,27 +968,27 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
968
968
|
return d;
|
|
969
969
|
} });
|
|
970
970
|
if (!(n != null && n.user)) return null;
|
|
971
|
-
if (s.isLoading) return e(
|
|
971
|
+
if (s.isLoading) return e(xr, { title: "Reservation history", description: "Loading your reservations." });
|
|
972
972
|
const l = ((o = s.data) == null ? void 0 : o.list) ?? [];
|
|
973
|
-
return e(Et, { eyebrow: "My account", title: "Reservation history", description: "Keep track of upcoming tables, past visits, and every booking status change in one place.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(Y, { asChild: !0, children: e(E, { href: "/account/reservations/book", children: "Book a table" }) })] }), children: e("div", { children: e(da, { title: "Your bookings", description: "Open any reservation to review the confirmation timeline and details.", action: e(it, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(He, { icon: ta, title: "We couldn't load your reservations", description: "Please refresh the page and try again. Your booking history will return as soon as the connection is restored." }) : l.length === 0 ? e(He, { icon: ta, title: "No reservations yet", description: "Once you book a table, this page will keep the full history of confirmed, pending, and cancelled reservations.", actionHref: "/account/reservations/book", actionLabel: "Book a table" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/reservations/${d.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Ze(d.date, "Date pending", "EEEE, MMM d") }), e(rt, { tone:
|
|
973
|
+
return e(Et, { eyebrow: "My account", title: "Reservation history", description: "Keep track of upcoming tables, past visits, and every booking status change in one place.", actions: i(C, { children: [e(Y, { asChild: !0, variant: "secondary", children: e(E, { href: "/account", children: "Back to account" }) }), e(Y, { asChild: !0, children: e(E, { href: "/account/reservations/book", children: "Book a table" }) })] }), children: e("div", { children: e(da, { title: "Your bookings", description: "Open any reservation to review the confirmation timeline and details.", action: e(it, { href: "/account", label: "Back to dashboard" }), children: s.isError ? e(He, { icon: ta, title: "We couldn't load your reservations", description: "Please refresh the page and try again. Your booking history will return as soon as the connection is restored." }) : l.length === 0 ? e(He, { icon: ta, title: "No reservations yet", description: "Once you book a table, this page will keep the full history of confirmed, pending, and cancelled reservations.", actionHref: "/account/reservations/book", actionLabel: "Book a table" }) : e("div", { className: "space-y-4", children: l.map((d) => e(E, { href: `/account/reservations/${d.id}`, className: "storefront-primary-border-hover group block rounded-[24px] border border-stone-200 bg-white p-5 transition duration-200 hover:-translate-y-0.5 hover:shadow-lg", children: i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between", children: [i("div", { className: "min-w-0", children: [i("div", { className: "flex flex-wrap items-center gap-2", children: [e("h3", { className: "font-red-hat-display text-lg font-black text-stone-950", children: Ze(d.date, "Date pending", "EEEE, MMM d") }), e(rt, { tone: Rn(d), children: Fn(d) })] }), i("p", { className: "mt-2 text-sm leading-6 text-stone-600", children: ["Ref ", d.referenceId, " • ", d.guests, " ", "guest", d.guests === 1 ? "" : "s"] }), i("div", { className: "mt-4 inline-flex rounded-full border border-stone-200 bg-stone-50 px-3 py-1 text-xs font-medium text-stone-600", children: ["Reserved under ", d.firstname, " ", d.lastname] })] }), i("div", { className: "shrink-0 text-left lg:text-right", children: [e("p", { className: "text-lg font-black text-stone-950", children: Ze(d.date, "Awaiting time", "h:mm a") }), i("p", { className: "mt-1 text-sm text-stone-500", children: ["Created", " ", Ze(d.createdAt, "Recently")] }), e("p", { className: "mt-3 text-sm font-semibold text-stone-700 transition group-hover:text-stone-950", children: "View details" })] })] }) }, d.id)) }) }) }) });
|
|
974
974
|
}, Qd = () => {
|
|
975
|
-
const a = fe(), { signIn: t } = Re(), { baseUrl: r } = I(), n = (a == null ? void 0 : a.get("redirect")) ?? "/checkout/customer-details", { register: s, handleSubmit: l, formState: { errors: o, isSubmitting: d } } = me({ resolver: ue(
|
|
975
|
+
const a = fe(), { signIn: t } = Re(), { baseUrl: r } = I(), n = (a == null ? void 0 : a.get("redirect")) ?? "/checkout/customer-details", { register: s, handleSubmit: l, formState: { errors: o, isSubmitting: d } } = me({ resolver: ue(yn), shouldFocusError: !0 }), u = async (h) => {
|
|
976
976
|
await t.email({ email: h.email, password: h.password, callbackURL: `${r}${n}` });
|
|
977
977
|
}, c = async (h) => {
|
|
978
978
|
h.preventDefault(), await t.social({ provider: "google", callbackURL: `${r}${n}` });
|
|
979
979
|
};
|
|
980
980
|
return i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "h4 font-black font-red-hat-display", children: "Log in" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Login or create an account to continue. Don’t have an account?", " ", e(E, { className: "storefront-primary-text storefront-primary-text-hover", href: `/account/sign-up?redirect=${n}`, children: "Sign up" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: i(Y, { variant: "secondary", type: "button", className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2", onClick: c, children: [e(ht, { className: "size-4", "aria-hidden": "true" }), "Login with Google"] }) }), e(Sa, { className: "my-6", children: "or" }), i("form", { onSubmit: l(u), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(Ee, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(De, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...s("email") }), o.email && e("span", { className: "text-sm text-red-500", children: o.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Ee, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(De, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...s("password") }), o.password && e("span", { className: "text-sm text-red-500", children: o.password.message })] })] }), e(Y, { type: "submit", className: "shadow-none", isLoading: d, children: d ? "Submitting..." : "Continue" })] })] }), e(Sa, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "storefront-primary-text storefront-primary-text-hover", href: "#", children: "Reset password" })] })] });
|
|
981
981
|
}, Td = () => e(Qd, {}), Jd = () => {
|
|
982
|
-
const a = fe(), { signUp: t, signIn: r } = Re(), { baseUrl: n } = I(), s = (a == null ? void 0 : a.get("redirect")) ?? "/checkout/customer-details", { register: l, handleSubmit: o, formState: { errors: d } } = me({ resolver: ue(
|
|
982
|
+
const a = fe(), { signUp: t, signIn: r } = Re(), { baseUrl: n } = I(), s = (a == null ? void 0 : a.get("redirect")) ?? "/checkout/customer-details", { register: l, handleSubmit: o, formState: { errors: d } } = me({ resolver: ue(cr), shouldFocusError: !0 }), { isPending: u, isError: c, mutate: h } = L({ onMutate: async (p) => t.email({ email: p.email, password: p.password, name: `${p.firstname} ${p.lastname}`, firstname: p.firstname, lastname: p.lastname, callbackURL: `${n}${s}` }) });
|
|
983
983
|
return e(C, { children: i("div", { className: "flex w-full flex-col items-start md:max-w-sm", children: [i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "h4 font-black font-red-hat-display", children: "Create an account" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Already have an account?", " ", e(E, { className: "storefront-primary-text storefront-primary-text-hover", href: "/account/sign-in", children: "Sign in" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: i(Y, { variant: "secondary", type: "button", className: "mt-2 w-full sm:mt-0 inline-flex items-center gap-2 shadow-none", onClick: async (p) => (p.preventDefault(), r.social({ provider: "google", callbackURL: `${n}${s}` })), children: [e(ht, { className: "size-4", "aria-hidden": "true" }), "Signin with Google"] }) }), e(Sa, { className: "my-6", children: "or" }), i("form", { onSubmit: o((p) => h(p)), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(Ee, { htmlFor: "email-form-item", className: "font-medium", children: "First Name" }), e(De, { type: "text", id: "email-form-item", placeholder: "Emily", ...l("firstname") }), d.firstname && e("span", { className: "text-sm text-red-500", children: d.firstname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Ee, { htmlFor: "email-form-item", className: "font-medium", children: "Last Name" }), e(De, { type: "text", id: "email-form-item", placeholder: "Emily", ...l("lastname") }), d.lastname && e("span", { className: "text-sm text-red-500", children: d.lastname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Ee, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(De, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...l("email") }), d.email && e("span", { className: "text-sm text-red-500", children: d.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(Ee, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(De, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...l("password") }), d.password && e("span", { className: "text-sm text-red-500", children: d.password.message })] })] }), c && e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }), e(Y, { type: "submit", isLoading: u, children: u ? "Submitting..." : "Continue" })] })] }), e(Sa, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "storefront-primary-text storefront-primary-text-hover", href: "#", children: "Reset password" })] })] }) });
|
|
984
|
-
}, Od = () => e(Jd, {}),
|
|
984
|
+
}, Od = () => e(Jd, {}), sp = () => {
|
|
985
985
|
const { segments: a } = ji(), [t, ...r] = a ?? [];
|
|
986
986
|
if (!t) return e(Xe, { children: e(vd, {}) });
|
|
987
987
|
switch (t) {
|
|
988
988
|
case "sign-in":
|
|
989
|
-
return r.length !== 0 ? ea() : e(
|
|
989
|
+
return r.length !== 0 ? ea() : e($r, { children: e(Td, {}) });
|
|
990
990
|
case "sign-up":
|
|
991
|
-
return r.length !== 0 ? ea() : e(
|
|
991
|
+
return r.length !== 0 ? ea() : e($r, { children: e(Od, {}) });
|
|
992
992
|
case "orders":
|
|
993
993
|
return r.length > 1 ? ea() : r.length === 0 ? e(Xe, { children: e(Fd, {}) }) : e(Xe, { children: e(zd, { orderId: r[0] }) });
|
|
994
994
|
case "reservations":
|
|
@@ -997,18 +997,18 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
997
997
|
return ea();
|
|
998
998
|
}
|
|
999
999
|
}, Ld = (a) => {
|
|
1000
|
-
if (a[0] === "reservation" && a.length === 1) return e(
|
|
1000
|
+
if (a[0] === "reservation" && a.length === 1) return e(_r, {});
|
|
1001
1001
|
if (a.length !== 1) return ea();
|
|
1002
1002
|
switch (a[0]) {
|
|
1003
1003
|
case "customer-details":
|
|
1004
|
-
return e(
|
|
1004
|
+
return e(_r, {});
|
|
1005
1005
|
case "shipping-and-payment":
|
|
1006
1006
|
return e(ud, {});
|
|
1007
1007
|
default:
|
|
1008
1008
|
return ea();
|
|
1009
1009
|
}
|
|
1010
|
-
},
|
|
1011
|
-
const a = ji(), { useSession: t } = Re(), r = _(), { data: n, isPending: s } = t(), { loading: l, formattedCartItems: o, total: d, subtotal: u, shipping: c } =
|
|
1010
|
+
}, lp = () => {
|
|
1011
|
+
const a = ji(), { useSession: t } = Re(), r = _(), { data: n, isPending: s } = t(), { loading: l, formattedCartItems: o, total: d, subtotal: u, shipping: c } = nr(), { organization: h, loading: p } = Ne(), g = (a == null ? void 0 : a.segments) || [];
|
|
1012
1012
|
if (ee(() => {
|
|
1013
1013
|
!s && !n && r.push("/account/sign-in?redirect=/checkout/customer-details");
|
|
1014
1014
|
}, [n, s, r]), p || l || s) return e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900", children: e("div", { className: "mb-4", children: e("div", { className: "storefront-primary-border animate-spin rounded-full h-18 w-18 border-b-2" }) }) });
|
|
@@ -1017,7 +1017,7 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1017
1017
|
const b = [h.phone, h.email].filter((f) => !!f);
|
|
1018
1018
|
return e("div", { className: "flex flex-col items-center justify-center h-screen w-screen bg-gray-900 text-center animate-fade-in", children: h.configuration.isOpen ? i("div", { className: "relative z-10 max-w-[800px] px-10", children: [e("h1", { className: "text-2xl sm:text-3xl font-black font-red-hat-display text-white", children: "Unfortunately, We're currently not accepting online orders." }), i("p", { className: "text-gray-100 font-medium mt-3 text-lg mt-", children: ["Please contact us directly for any inquiries.", b.map((f) => i(S.Fragment, { children: [e("br", {}), f] }, f))] }), e(E, { className: "storefront-primary-action btn-sm mt-6 rounded-lg shrink-0", href: "/", children: "Back to Homepage" })] }) : i("div", { className: "relative z-10", children: [e("h1", { className: "text-2xl sm:text-3xl font-black font-red-hat-display text-white", children: "Sorry, we're currently closed" }), i("p", { className: "text-gray-100 font-medium mt-3 text-lg mt-", children: ["Please contact us directly for any inquiries.", b.map((f) => i(S.Fragment, { children: [e("br", {}), f] }, f))] }), e(E, { className: "storefront-primary-action btn-sm mt-6 rounded-lg shrink-0", href: "/", children: "Back to Homepage" })] }) });
|
|
1019
1019
|
}
|
|
1020
|
-
return i(C, { children: [e(Pa, { summary: { total: d, subtotal: u, shipping: c, items: o } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: i("div", { className: "w-96 animate-fade", children: [e("div", { className: "pl-6", children: e(
|
|
1020
|
+
return i(C, { children: [e(Pa, { summary: { total: d, subtotal: u, shipping: c, items: o } }), e("div", { children: i("div", { className: "flex flex-col md:flex-row h-screen w-screen relative", children: [e("div", { className: "hidden md:flex items-center justify-end w-full md:w-1/2 h-full px-16 xl:px-24 bg-gray-900 md:overflow-y-auto", children: i("div", { className: "w-96 animate-fade", children: [e("div", { className: "pl-6", children: e(br, { items: o, total: d, subtotal: u, shipping: c, currency: h.configuration.defaultCurrency || "USD" }) }), i("p", { className: "text-xs text-gray-500 dark:text-gray-400 text-center mt-14 w-full", children: ["Powered by", " ", e("a", { href: "https://shophost.io", className: "storefront-primary-text storefront-primary-text-hover", children: "shophost.io" })] })] }) }), e("div", { className: "flex flex-col items-start 2xl:items-start w-full md:w-1/2 h-full px-6 sm:px-12 xl:px-24 py-8 md:overflow-y-auto relative", children: e("div", { className: "py-10 xl:py-24 md:my-auto animate-fade w-full md:max-w-[432px]", children: Ld(g) }) })] }) })] });
|
|
1021
1021
|
}, jd = ({ children: a }) => {
|
|
1022
1022
|
const { isOpen: t, onClose: r, product: n, modifierGroups: s, hasModifiers: l, productName: o, quantity: d, handleIncrement: u, handleDecrement: c, handleAddToCart: h, validationError: p } = wt();
|
|
1023
1023
|
if (!n) return null;
|
|
@@ -1033,12 +1033,12 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1033
1033
|
return a({ modifier: t, isSelected: h, onSelect: () => {
|
|
1034
1034
|
g ? l(r, t.id) : o(r, t.id);
|
|
1035
1035
|
}, isMultiSelect: g, formattedPrice: b });
|
|
1036
|
-
}, Hd = e("div", { className: "p-4 text-center text-gray-500", children: "This product has no modifiers." }),
|
|
1036
|
+
}, Hd = e("div", { className: "p-4 text-center text-gray-500", children: "This product has no modifiers." }), op = ({ addToCartLabel: a = "Add to Cart", emptyState: t = Hd, panelClassName: r, renderFooter: n, renderGroup: s, renderHeader: l, renderOption: o }) => e(jd, { children: ({ isOpen: d, onClose: u, product: c, modifierGroups: h, quantity: p, onIncrement: g, onDecrement: b, isDecrementDisabled: f, onAddToCart: w, validationError: y }) => e(Ct, { open: d, onOpenChange: (k) => {
|
|
1037
1037
|
k || u();
|
|
1038
|
-
}, children: i(St, { className: x("w-full sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-auto p-0", "top-auto left-0 right-0 bottom-0 translate-x-0 translate-y-0 rounded-t-xl rounded-b-none border-none", "sm:top-1/2 sm:left-1/2 sm:right-auto sm:bottom-auto sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:border", r), children: [l ? l({ onClose: u, product: c }) : i("div", { className: "flex justify-between items-start p-4", children: [e("div", { className: "absolute left-1/2 -translate-x-1/2 top-2 w-12 h-1.5 bg-gray-300 rounded-full sm:hidden" }), i("div", { className: "mt-4 sm:mt-0", children: [e(
|
|
1038
|
+
}, children: i(St, { className: x("w-full sm:max-w-md max-h-[75vh] sm:max-h-[90vh] overflow-auto p-0", "top-auto left-0 right-0 bottom-0 translate-x-0 translate-y-0 rounded-t-xl rounded-b-none border-none", "sm:top-1/2 sm:left-1/2 sm:right-auto sm:bottom-auto sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl sm:border", r), children: [l ? l({ onClose: u, product: c }) : i("div", { className: "flex justify-between items-start p-4", children: [e("div", { className: "absolute left-1/2 -translate-x-1/2 top-2 w-12 h-1.5 bg-gray-300 rounded-full sm:hidden" }), i("div", { className: "mt-4 sm:mt-0", children: [e(mr, { className: "text-2xl font-black font-red-hat-display", children: c.title }), e("p", { className: "text-sm text-gray-500", children: c.description })] }), e("button", { type: "button", onClick: u, className: "cursor-pointer text-gray-500 hover:text-gray-700 text-2xl leading-none mt-4 sm:mt-0", "aria-label": "Close modal", children: "×" })] }), h.length > 0 ? e("div", { className: "px-4", children: h.map((k) => e(Vd, { group: k, renderOptions: () => k.modifiers.map((v) => e(Zd, { modifier: v, groupId: k.id, children: (N) => o ? o(N) : i("div", { className: x("flex items-center py-2.5 px-3 border rounded-lg cursor-pointer text-sm font-medium text-gray-600 dark:text-gray-400 mb-2", N.isSelected ? "border-blue-500 bg-blue-50" : "border-gray-200"), onClick: N.onSelect, children: [e("input", { type: N.isMultiSelect ? "checkbox" : "radio", checked: N.isSelected, className: "mr-2", onChange: (R) => R.preventDefault() }), i("span", { children: [N.modifier.title, N.formattedPrice] })] }) }, v.id)), children: (v) => s ? s(v) : i("div", { className: "mb-4", children: [i("div", { className: "font-medium mb-2", children: [i("div", { className: "flex items-center font-black font-red-hat-display text-lg", children: [v.groupName, v.isRequired && e("span", { className: "text-red-500 ml-1", children: "*" })] }), v.selectionRequirements && i("span", { className: "text-sm text-gray-600 dark:text-gray-400", children: ["Select ", v.selectionRequirements] })] }), e("div", { children: v.renderOptions() })] }) }, k.id)) }) : t, n ? n({ isDecrementDisabled: f, onAddToCart: w, onDecrement: b, onIncrement: g, quantity: p, validationError: y }) : i(C, { children: [i("div", { className: "p-4 flex items-center justify-center border-t mt-8", children: [e("button", { type: "button", onClick: b, className: x("w-8 h-8 flex items-center justify-center border rounded-lg", f ? "opacity-50 cursor-not-allowed" : "cursor-pointer"), "aria-label": "Decrease quantity", disabled: f, children: "-" }), e("span", { className: "w-12 text-center", children: p }), e("button", { type: "button", onClick: g, className: "w-8 h-8 flex items-center justify-center border rounded-lg cursor-pointer", "aria-label": "Increase quantity", children: "+" })] }), i("div", { className: "p-4 border-t", children: [y && e("div", { className: "text-red-500 mb-2", children: y }), e("button", { type: "button", onClick: w, className: "storefront-primary-action btn text-sm rounded-lg w-full", children: a })] })] })] }) }) }), dp = ({ children: a, minQuantity: t = 1 }) => {
|
|
1039
1039
|
const { quantity: r, handleIncrement: n, handleDecrement: s } = wt(), l = r <= t;
|
|
1040
1040
|
return a({ quantity: r, onIncrement: n, onDecrement: s, isDecrementDisabled: l });
|
|
1041
|
-
},
|
|
1041
|
+
}, cp = ({ children: a, locale: t = "en" }) => e(tn, { locale: t, children: a }), mp = (a, t = []) => {
|
|
1042
1042
|
const [r, n] = F(null), [s, l] = F(!0), [o, d] = F(null), u = JSON.stringify(t.map((c) => c.id));
|
|
1043
1043
|
return ee(() => {
|
|
1044
1044
|
(async () => {
|
|
@@ -1054,7 +1054,7 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
})();
|
|
1056
1056
|
}, [a, u]), { product: r, loading: s, error: o };
|
|
1057
|
-
},
|
|
1057
|
+
}, up = (a, t = []) => {
|
|
1058
1058
|
const [r, n] = F({}), [s, l] = F(!0), [o, d] = F(null), u = JSON.stringify(a.sort());
|
|
1059
1059
|
return ee(() => {
|
|
1060
1060
|
const c = async () => {
|
|
@@ -1072,7 +1072,7 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1072
1072
|
};
|
|
1073
1073
|
a.length > 0 ? c() : (n({}), l(!1));
|
|
1074
1074
|
}, [u, t]), { products: r, getProduct: (c) => r[c] || null, loading: s, error: o };
|
|
1075
|
-
},
|
|
1075
|
+
}, pp = [{ id: "product-1", slug: "classic-burger", sku: "BURGER-001", basePrice: 12.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-1", url: "https://images.unsplash.com/photo-1568901346375-23c9450c58cd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 65783, filename: "classic-burger.jpeg" }], modifierGroups: [], categories: [{ id: "cat-1", slug: "burgers", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Burgers", description: "" }, { locale: "pl", title: "Burgery", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Classic Burger", description: "A juicy beef patty with lettuce, tomato, onion, and our special sauce on a toasted bun." }, { locale: "pl", title: "Klasyczny Burger", description: "Soczysta wołowina z sałatą, pomidorem, cebulą i naszym specjalnym sosem na opiekanej bułce." }] }, { id: "product-2", slug: "custom-pizza", sku: "PIZZA-001", basePrice: 14.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-2", url: "https://images.unsplash.com/photo-1513104890138-7c749659a591?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 75783, filename: "custom-pizza.jpeg" }], modifierGroups: [{ id: "mod-group-1", selectMin: 1, selectMax: 1, modifiers: [{ id: "mod-1-1", title: "Thin Crust", sku: null, price: 0 }, { id: "mod-1-2", title: "Regular Crust", sku: null, price: 0 }, { id: "mod-1-3", title: "Thick Crust", sku: null, price: 2 }], translations: [{ locale: "en", title: "Crust Type" }, { locale: "pl", title: "Rodzaj Ciasta" }] }, { id: "mod-group-2", selectMin: 1, selectMax: 1, modifiers: [{ id: "mod-2-1", title: "Tomato Sauce", sku: null, price: 0 }, { id: "mod-2-2", title: "White Sauce", sku: null, price: 0 }, { id: "mod-2-3", title: "BBQ Sauce", sku: null, price: 0 }], translations: [{ locale: "en", title: "Sauce" }, { locale: "pl", title: "Sos" }] }], categories: [{ id: "cat-2", slug: "pizza", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Pizza", description: "" }, { locale: "pl", title: "Pizza", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Custom Pizza", description: "Build your own pizza with your choice of crust and sauce. Comes with cheese and tomatoes." }, { locale: "pl", title: "Pizza Własna", description: "Zbuduj własną pizzę z wybranym rodzajem ciasta i sosu. Zawiera ser i pomidory." }] }, { id: "product-3", slug: "build-your-salad", sku: "SALAD-001", basePrice: 9.99, discountedBasePrice: null, currency: "USD", images: [{ id: "img-3", url: "https://images.unsplash.com/photo-1512621776951-a57141f2eefd?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80", mimeType: "image/jpeg", size: 55783, filename: "build-your-salad.jpeg" }], modifierGroups: [{ id: "mod-group-3", selectMin: 0, selectMax: 5, modifiers: [{ id: "mod-3-1", title: "Grilled Chicken", sku: null, price: 2.5 }, { id: "mod-3-2", title: "Bacon", sku: null, price: 1.5 }, { id: "mod-3-3", title: "Avocado", sku: null, price: 2 }, { id: "mod-3-4", title: "Feta Cheese", sku: null, price: 1 }, { id: "mod-3-5", title: "Boiled Egg", sku: null, price: 1 }], translations: [{ locale: "en", title: "Toppings" }, { locale: "pl", title: "Dodatki" }] }, { id: "mod-group-4", selectMin: 0, selectMax: 1, modifiers: [{ id: "mod-4-1", title: "Ranch", sku: null, price: 0 }, { id: "mod-4-2", title: "Balsamic Vinaigrette", sku: null, price: 0 }, { id: "mod-4-3", title: "Caesar", sku: null, price: 0 }, { id: "mod-4-4", title: "Olive Oil & Lemon", sku: null, price: 0 }], translations: [{ locale: "en", title: "Dressing" }, { locale: "pl", title: "Dressing" }] }], categories: [{ id: "cat-3", slug: "salads", createdAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Salads", description: "" }, { locale: "pl", title: "Sałatki", description: "" }] }], manufacturerId: null, createdAt: "2023-01-01T00:00:00.000Z", publishedAt: "2023-01-01T00:00:00.000Z", translations: [{ locale: "en", title: "Build Your Salad", description: "Fresh mixed greens with cherry tomatoes, cucumber, and red onion. Add your favorite toppings and dressing." }, { locale: "pl", title: "Skomponuj Swoją Sałatkę", description: "Świeże mieszane sałaty z pomidorkami koktajlowymi, ogórkiem i czerwoną cebulą. Dodaj ulubione dodatki i dressing." }] }], Ud = new di({ defaultOptions: { queries: { retry: !1, refetchInterval: !1, refetchOnWindowFocus: !1 } } }), nt = "#ffffff", Xr = "#0f172a", Tn = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, qd = /^(?:rgb|rgba|hsl|hsla|oklch|oklab|var)\([^;{}]+\)$/i, Wd = /^(?:bg-)?([a-z]+(?:-[a-z]+)*)-(\d{2,3})$/, _t = kl, _d = _t.teal, ei = _d[500], $d = (a) => {
|
|
1076
1076
|
const t = a.trim();
|
|
1077
1077
|
if (t.length === 4 || t.length === 5) {
|
|
1078
1078
|
const [r, ...n] = t;
|
|
@@ -1083,51 +1083,51 @@ const od = ({ initialData: a, shippingAndPaymentPageUrl: t }) => {
|
|
|
1083
1083
|
const t = a / 255;
|
|
1084
1084
|
return t <= 0.03928 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
|
|
1085
1085
|
}, ai = (a) => {
|
|
1086
|
-
const t =
|
|
1086
|
+
const t = $d(a).slice(1, 7), r = Number.parseInt(t.slice(0, 2), 16), n = Number.parseInt(t.slice(2, 4), 16), s = Number.parseInt(t.slice(4, 6), 16);
|
|
1087
1087
|
return 0.2126 * Zt(r) + 0.7152 * Zt(n) + 0.0722 * Zt(s);
|
|
1088
1088
|
}, ti = (a, t) => {
|
|
1089
1089
|
const r = ai(a), n = ai(t), s = Math.max(r, n), l = Math.min(r, n);
|
|
1090
1090
|
return (s + 0.05) / (l + 0.05);
|
|
1091
1091
|
}, ri = (a) => {
|
|
1092
|
-
if (
|
|
1092
|
+
if (Tn.test(a)) {
|
|
1093
1093
|
const r = ti(a, "#ffffff"), n = ti(a, "#000000");
|
|
1094
1094
|
return r >= n ? nt : Xr;
|
|
1095
1095
|
}
|
|
1096
1096
|
const t = a.match(/^oklch\(([\d.]+)%/i);
|
|
1097
1097
|
return t && Number.parseFloat(t[1]) >= 78 ? Xr : nt;
|
|
1098
|
-
},
|
|
1098
|
+
}, Gd = (a) => {
|
|
1099
1099
|
const t = a.match(Wd);
|
|
1100
1100
|
if (t) {
|
|
1101
|
-
const [, s, l] = t, o =
|
|
1101
|
+
const [, s, l] = t, o = _t[s];
|
|
1102
1102
|
if (o && typeof o != "string") return o[l];
|
|
1103
1103
|
}
|
|
1104
|
-
const r = a.replace(/^bg-/, ""), n =
|
|
1104
|
+
const r = a.replace(/^bg-/, ""), n = _t[r];
|
|
1105
1105
|
if (typeof n == "string") return n;
|
|
1106
|
-
}, Gd = (a) => {
|
|
1107
|
-
const t = a == null ? void 0 : a.trim();
|
|
1108
|
-
if (!t) return { color: Yr, foreground: nt };
|
|
1109
|
-
const r = $d(t);
|
|
1110
|
-
return r ? { color: r, foreground: ri(r) } : Jn.test(t) || qd.test(t) ? { color: t, foreground: ri(t) } : { color: Yr, foreground: nt };
|
|
1111
1106
|
}, Kd = (a) => {
|
|
1112
|
-
const
|
|
1107
|
+
const t = a == null ? void 0 : a.trim();
|
|
1108
|
+
if (!t) return { color: ei, foreground: nt };
|
|
1109
|
+
const r = Gd(t);
|
|
1110
|
+
return r ? { color: r, foreground: ri(r) } : Tn.test(t) || qd.test(t) ? { color: t, foreground: ri(t) } : { color: ei, foreground: nt };
|
|
1111
|
+
}, Yd = (a) => {
|
|
1112
|
+
const { color: t, foreground: r } = Kd(a == null ? void 0 : a.primaryColor);
|
|
1113
1113
|
return `:root{--storefront-primary:${t};--storefront-primary-foreground:${r};}`;
|
|
1114
|
-
},
|
|
1115
|
-
const r = a != null && a.primaryColor ?
|
|
1116
|
-
return i(C, { children: [r ? e("style", { "data-shophost-storefront-appearance": !0, children: r }) : null, t] });
|
|
1117
|
-
},
|
|
1114
|
+
}, Xd = ({ appearance: a, children: t }) => {
|
|
1115
|
+
const r = a != null && a.primaryColor ? Yd(a) : null;
|
|
1116
|
+
return i(C, { children: [r ? e("style", { "data-shophost-storefront-appearance": !0, suppressHydrationWarning: !0, children: r }) : null, t] });
|
|
1117
|
+
}, hp = ({ appearance: a, baseUrl: t, children: r, initialOrganization: n, locale: s = "en", modifiersModal: l, organizationId: o }) => e(Xd, { appearance: a, children: e(Cd, { locale: s, children: e(hd, { baseURL: t, children: e(Wi, { baseUrl: t, children: e(ci, { client: Ud, children: e(Ll, { initialOrganization: n, organizationId: o, children: e(jl, { locale: s, organizationId: o, children: i(tn, { locale: s, children: [r, l] }) }) }) }) }) }) }) });
|
|
1118
1118
|
function X(...a) {
|
|
1119
1119
|
return Zi(Vi(...a));
|
|
1120
1120
|
}
|
|
1121
|
-
const fa = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], ye = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], zt = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"],
|
|
1121
|
+
const fa = ["focus:ring-2", "focus:ring-blue-200 dark:focus:ring-blue-700/30", "focus:border-blue-500 dark:focus:border-blue-700"], ye = ["outline outline-offset-2 outline-0 focus-visible:outline-2", "outline-blue-500 dark:outline-blue-500"], zt = ["ring-2", "border-red-500 dark:border-red-700", "ring-red-200 dark:ring-red-700/30"], ec = (a, t = 0) => Intl.NumberFormat("us", { minimumFractionDigits: t, maximumFractionDigits: t }).format(Number(a)).toString(), ne = { currency: (a, t = "USD") => new Intl.NumberFormat("en-US", { style: "currency", currency: t }).format(a), unit: (a) => `${ec(a)}` }, ac = Le({ base: ["relative inline-flex items-center justify-center whitespace-nowrap rounded-lg border px-3 py-2 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out", "disabled:pointer-events-none disabled:shadow-none", ye], variants: { variant: { primary: ["border-transparent", "text-white dark:text-white", "bg-blue-600 dark:bg-blue-500", "shadow-[0_16px_8px_rgba(31,31,31,0.01),0_12px_6px_rgba(31,31,31,0.04),0_4px_4px_rgba(31,31,31,0.07),0_1.5px_3px_rgba(31,31,31,0.08),0_0_0_1px_#2563eb,inset_0_1px_2px_hsla(0,0%,100%,0.12)] dark:outline-0 outline outline-2 outline-transparent outline-offset-2", "hover:bg-blue-500 dark:hover:bg-blue-600", "disabled:bg-blue-100 disabled:text-gray-400", "dark:disabled:bg-blue-800 dark:disabled:text-blue-400"], secondary: ["border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "shadow-[0_1px_1px_0.5px_rgba(51,51,51,.04),0_3px_3px_-1.5px_rgba(51,51,51,.02),0_6px_6px_-3px_rgba(51,51,51,.04),0_12px_12px_-6px_rgba(51,51,51,.04),0_24px_24px_-12px_rgba(51,51,51,.04),0_48px_48px_-24px_rgba(51,51,51,.04),0_0_0_1px_rgba(51,51,51,.1),inset_0_-1px_1px_-0.5px_rgba(51,51,51,.06)] outline outline-2 dark:outline-0 outline-transparent outline-offset-2", "hover:bg-gray-50 dark:hover:bg-gray-900/60", "disabled:text-gray-400", "dark:disabled:text-gray-600"], light: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-gray-200 dark:bg-gray-900", "hover:bg-gray-300/70 dark:hover:bg-gray-800/80", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:bg-gray-800 dark:disabled:text-gray-600"], ghost: ["shadow-none", "border-transparent", "text-gray-900 dark:text-gray-50", "bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800/80", "disabled:text-gray-400", "dark:disabled:text-gray-600"], destructive: ["text-white", "border-transparent", "bg-red-600 dark:bg-red-700", "hover:bg-red-700 dark:hover:bg-red-600", "disabled:bg-red-300 disabled:text-white", "dark:disabled:bg-red-950 dark:disabled:text-red-400"] } }, defaultVariants: { variant: "primary" } }), z = S.forwardRef(({ asChild: a, isLoading: t = !1, loadingText: r, className: n, disabled: s, variant: l, children: o, ...d }, u) => e(a ? tr : "button", { ref: u, className: x(ac({ variant: l }), n), disabled: s || t, ...d, children: t ? i("span", { className: "pointer-events-none flex shrink-0 items-center justify-center gap-1.5", children: [e(Ri, { className: "size-4 shrink-0 animate-spin", "aria-hidden": "true" }), e("span", { className: "sr-only", children: r || "Loading" }), r || "Loading"] }) : o }));
|
|
1122
1122
|
z.displayName = "Button";
|
|
1123
|
-
function
|
|
1123
|
+
function Jn({ onReset: a }) {
|
|
1124
1124
|
return e("div", { className: "shophost-admin flex h-screen flex-col items-center justify-center gap-4", children: e("div", { className: "py-8 px-4 mx-auto max-w-(--breakpoint-xl) pb-64 lg:px-6", children: i("div", { className: "mx-auto max-w-(--breakpoint-sm) text-center", children: [e("h1", { className: "mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-red-500 dark:text-primary-500", children: "500" }), e("p", { className: "mb-3 font-red-hat-display text-3xl tracking-tight font-bold text-gray-800 md:text-4xl dark:text-white", children: "Something went wrong" }), i("p", { className: "mb-4 text-lg text-gray-500 dark:text-gray-400", children: ["We are sorry, but there was an unexpected error. ", e("br", {}), "Please try reloading the page."] }), a && e(z, { className: "mt-3", onClick: a, children: "Reload Page" })] }) }) });
|
|
1125
1125
|
}
|
|
1126
1126
|
const Dt = Ce({});
|
|
1127
|
-
function
|
|
1127
|
+
function tc({ children: a, organizationId: t, id: r }) {
|
|
1128
1128
|
return e(Dt.Provider, { value: { organizationId: t, id: r }, children: a });
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1130
|
+
function rc() {
|
|
1131
1131
|
return ge(Dt);
|
|
1132
1132
|
}
|
|
1133
1133
|
function U() {
|
|
@@ -1140,12 +1140,12 @@ function Qa() {
|
|
|
1140
1140
|
if (!a) throw new Error("useRouteId called outside a detail route");
|
|
1141
1141
|
return a;
|
|
1142
1142
|
}
|
|
1143
|
-
const
|
|
1143
|
+
const ic = Ce(void 0), nc = ({ children: a, initialState: t = !1 }) => {
|
|
1144
1144
|
const [r, n] = F(t);
|
|
1145
|
-
return e(
|
|
1146
|
-
}, de = ({ className: a, ...t }) => i("svg", { "aria-hidden": "true", className: x("text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", a), viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t, children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }),
|
|
1145
|
+
return e(ic.Provider, { value: { flyoutOpen: r, setFlyoutOpen: n }, children: a });
|
|
1146
|
+
}, de = ({ className: a, ...t }) => i("svg", { "aria-hidden": "true", className: x("text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", a), viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t, children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), On = Ce(null), ii = ({ children: a }) => {
|
|
1147
1147
|
var u, c, h, p, g;
|
|
1148
|
-
const { client: t } = I(), { organizationId: r } =
|
|
1148
|
+
const { client: t } = I(), { organizationId: r } = rc(), n = Q({ queryKey: ["organizations"], queryFn: async () => {
|
|
1149
1149
|
const { body: b, status: f } = await t.organization.getOrganizations();
|
|
1150
1150
|
if (f !== 200) throw f !== 401 && O.error("Failed to update organizations list. Please refresh the page or try again later."), new Error("Failed to fetch organizations");
|
|
1151
1151
|
return b;
|
|
@@ -1154,32 +1154,32 @@ const rc = Ce(void 0), ic = ({ children: a, initialState: t = !1 }) => {
|
|
|
1154
1154
|
if (f !== 200) throw f !== 401 && O.error("Failed to fetch organization. Please try refreshing the page or try again later."), new Error("Failed to fetch organizations");
|
|
1155
1155
|
return b;
|
|
1156
1156
|
}, enabled: !!r }), l = ((u = s.data) == null ? void 0 : u.configuration.defaultLocale) ?? "en", o = ((c = s.data) == null ? void 0 : c.configuration.defaultCurrency) ?? "USD", d = ((p = (h = s.data) == null ? void 0 : h.configuration.supportedLocales) == null ? void 0 : p.sort((b) => b === l ? -1 : 1)) || ["en"];
|
|
1157
|
-
return e(
|
|
1157
|
+
return e(On.Provider, { value: { defaultLocale: l, defaultCurrency: o, supportedLocales: d, organizations: { loading: n.isLoading, data: ((g = n.data) == null ? void 0 : g.list) ?? [], error: n.isError }, organization: { loading: s.isLoading, data: s.data ?? null, error: s.isError } }, children: s.isLoading || n.isLoading ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : a });
|
|
1158
1158
|
}, be = () => {
|
|
1159
|
-
const a = ge(
|
|
1159
|
+
const a = ge(On);
|
|
1160
1160
|
if (!a) throw new Error("useOrganization must be used within a OrganizationProvider");
|
|
1161
1161
|
return a;
|
|
1162
|
-
},
|
|
1163
|
-
function
|
|
1162
|
+
}, sc = "redirect";
|
|
1163
|
+
function lc(a) {
|
|
1164
1164
|
return a.startsWith("/") && !a.startsWith("//");
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function oc(a, t) {
|
|
1167
1167
|
return a === t || a.startsWith(`${t}/`);
|
|
1168
1168
|
}
|
|
1169
1169
|
function Ft(a, t) {
|
|
1170
|
-
return !a || !
|
|
1170
|
+
return !a || !lc(a) || !oc(a, t.home) || a === t.signIn || a === t.signUp ? t.home : a;
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const r = new URLSearchParams({ [
|
|
1172
|
+
function wr(a, t) {
|
|
1173
|
+
const r = new URLSearchParams({ [sc]: t });
|
|
1174
1174
|
return `${a}?${r.toString()}`;
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function Ln(a, t, r) {
|
|
1177
1177
|
const n = Ft(t, r);
|
|
1178
1178
|
return new URL(n, a).toString();
|
|
1179
1179
|
}
|
|
1180
1180
|
const W = S.forwardRef(({ className: a, children: t, ...r }, n) => e("div", { ref: n, className: x("mx-auto my-6 flex w-full items-center justify-between gap-3 text-sm col-span-full", "text-gray-500 dark:text-gray-500", a), ...r, children: t ? i(C, { children: [e("div", { className: x("h-[1px] w-full", "bg-gray-200 dark:bg-gray-800") }), e("div", { className: "whitespace-nowrap text-inherit", children: t }), e("div", { className: x("h-[1px] w-full", "bg-gray-200 dark:bg-gray-800") })] }) : e("div", { className: x("h-[0.5px] w-full", "bg-gray-200 dark:bg-gray-800") }) }));
|
|
1181
1181
|
W.displayName = "Divider";
|
|
1182
|
-
const
|
|
1182
|
+
const dc = Le({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 shadow-xs outline-hidden transition sm:text-sm", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-white dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", fa], variants: { hasError: { true: zt }, enableStepper: { false: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none" }, multiline: { true: "resize-y min-h-[100px]", false: "truncate appearance-none" } } }), pe = S.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n = !0, type: s, multiline: l = !1, prefix: o, suffix: d, copyValue: u, copySuccessMessage: c = "Copied to clipboard.", copyErrorMessage: h = "Failed to copy to clipboard. Please try again.", ...p }, g) => {
|
|
1183
1183
|
const [b, f] = S.useState(s), [w, y] = S.useState(!1), k = s === "password" && !l, v = s === "search" && !l, N = !!u, R = s === "textarea" ? "textarea" : "input", T = async () => {
|
|
1184
1184
|
if (u) try {
|
|
1185
1185
|
y(!0), await navigator.clipboard.writeText(u), O.success(c);
|
|
@@ -1189,34 +1189,34 @@ const oc = Le({ base: ["relative block w-full rounded-lg border px-2.5 py-2.5 sh
|
|
|
1189
1189
|
y(!1);
|
|
1190
1190
|
}
|
|
1191
1191
|
};
|
|
1192
|
-
return i("div", { className: x("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(R, { ref: g, type: k ? b : s, className: x(
|
|
1192
|
+
return i("div", { className: x("relative w-full", a), children: [o && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center px-3 text-slate-600 dark:text-gray-600 z-10 text-sm border-r border-gray-200", children: o }), e(R, { ref: g, type: k ? b : s, className: x(dc({ hasError: r, enableStepper: l ? !1 : n, multiline: l }), { "pl-16": o, "pl-8": !o && v, "pr-24": N, "pr-10": !N && (d || !d && k) }, t), ...p }), !o && v && e("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2 text-gray-400 dark:text-gray-600", children: e(Xt, { className: "size-[1.125rem]" }) }), N && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-1.5", children: i(z, { type: "button", variant: "ghost", onClick: T, isLoading: w, loadingText: "Copying...", className: "h-8 cursor-pointer px-2 text-xs hover:text-gray-600 dark:hover:bg-gray-800", children: [e(Qs, { className: "size-4", "aria-hidden": "true" }), e("span", { className: "sr-only", children: "Copy value" })] }) }), !N && d && e("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2 text-gray-400 dark:text-gray-600", children: d }), !N && !d && k && e("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3", children: e("button", { onClick: () => f(b === "password" ? "text" : "password"), className: x(ye, "text-gray-400 hover:text-gray-500 dark:text-gray-600"), children: b === "password" ? e(Bi, { className: "size-5" }) : e(Mi, { className: "size-5" }) }) })] });
|
|
1193
1193
|
});
|
|
1194
1194
|
pe.displayName = "Input";
|
|
1195
1195
|
const ke = A.forwardRef(({ className: a, disabled: t, ...r }, n) => e(Hi.Root, { ref: n, className: X("text-sm leading-none", "text-gray-900 dark:text-gray-50", { "text-gray-400 dark:text-gray-600": t }, a), "aria-disabled": t, ...r }));
|
|
1196
1196
|
ke.displayName = "Label";
|
|
1197
|
-
const
|
|
1198
|
-
const a = _(), t = fe(), r = Fa(), n = K(), s = r.signIn, l = Ft(t == null ? void 0 : t.get("redirect"), n), { register: o, handleSubmit: d, formState: { errors: u, isSubmitting: c } } = me({ resolver: ue(
|
|
1197
|
+
const cc = () => {
|
|
1198
|
+
const a = _(), t = fe(), r = Fa(), n = K(), s = r.signIn, l = Ft(t == null ? void 0 : t.get("redirect"), n), { register: o, handleSubmit: d, formState: { errors: u, isSubmitting: c } } = me({ resolver: ue(yn), shouldFocusError: !0 }), h = () => a.push(l), p = async (b) => {
|
|
1199
1199
|
await s.email({ email: b.email, password: b.password, fetchOptions: { onSuccess: h } });
|
|
1200
1200
|
}, g = async () => {
|
|
1201
|
-
await s.social({ provider: "google", callbackURL:
|
|
1201
|
+
await s.social({ provider: "google", callbackURL: Ln(window.location.origin, l, n) });
|
|
1202
1202
|
};
|
|
1203
|
-
return e(C, { children: i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [e("div", { className: "relative flex items-center justify-center rounded-lg bg-white p-3 shadow-lg ring-1 ring-black/5", children: i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 481, zoomAndPan: "magnify", viewBox: "0 0 360.75 362.250002", height: 483, preserveAspectRatio: "xMidYMid meet", className: "size-8 text-blue-500 dark:text-blue-500", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "2330832e18", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("clipPath", { id: "5855bcb1c8", children: e("path", { d: "M 49 49.945312 L 357 49.945312 L 357 361.257812 L 49 361.257812 Z M 49 49.945312 ", clipRule: "nonzero" }) }), e("clipPath", { id: "2af377de26", children: e("path", { d: "M 226.65625 348.957031 L 345.746094 229.867188 C 359.820312 215.792969 359.820312 193.058594 345.746094 178.984375 L 228.101562 61.339844 C 220.160156 53.398438 209.515625 49.070312 198.328125 49.070312 L 50.730469 49.070312 L 180.644531 178.984375 C 194.71875 193.058594 194.71875 215.792969 180.644531 229.867188 L 49.285156 361.226562 L 196.882812 361.226562 C 208.070312 361.226562 218.71875 356.714844 226.65625 348.957031 Z M 226.65625 348.957031 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", id: "dfad2cd726", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "161eaca8d9", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "5d3dc395e3", children: e("rect", { x: 0, width: 313, y: 0, height: 313 }) }), e("pattern", { id: "2569dd48be", patternUnits: "userSpaceOnUse", width: 313, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 48.148759, 361.331903)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 313 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#5d3dc395e3)", children: e("g", { mask: "url(#161eaca8d9)", children: e("rect", { x: "-127.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-80.78", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "2302aeb2c7", children: e("path", { d: "M 0.246094 0.90625 L 308 0.90625 L 308 312.21875 L 0.246094 312.21875 Z M 0.246094 0.90625 ", clipRule: "nonzero" }) }), e("clipPath", { id: "d6b3633872", children: e("path", { d: "M 177.617188 299.917969 L 296.707031 180.828125 C 310.78125 166.753906 310.78125 144.019531 296.707031 129.945312 L 179.0625 12.300781 C 171.121094 4.363281 160.476562 0.03125 149.289062 0.03125 L 1.691406 0.03125 L 131.605469 129.945312 C 145.679688 144.019531 145.679688 166.753906 131.605469 180.828125 L 0.246094 312.1875 L 147.84375 312.1875 C 159.03125 312.1875 169.679688 307.675781 177.617188 299.917969 Z M 177.617188 299.917969 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", id: "f9fee20a49", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "8bb974956b", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "4f6b6cd058", children: e("rect", { x: 0, width: 312, y: 0, height: 313 }) }), e("pattern", { id: "80e461df2c", patternUnits: "userSpaceOnUse", width: 312, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 0.247933, 312.433143)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 312 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#4f6b6cd058)", children: e("g", { mask: "url(#8bb974956b)", children: e("rect", { x: "-79.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-129.78", fillOpacity: 1 }) }) }) }) })] }), e("g", { clipPath: "url(#5855bcb1c8)", children: e("g", { clipPath: "url(#2af377de26)", children: e("path", { fill: "url(#2569dd48be)", d: "M 359.820312 361.226562 L 49.289062 361.226562 L 49.289062 49.945312 L 359.820312 49.945312 Z M 359.820312 361.226562 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#2302aeb2c7)", children: e("g", { clipPath: "url(#d6b3633872)", children: e("path", { fill: "url(#80e461df2c)", d: "M 310.78125 312.1875 L 0.25 312.1875 L 0.25 0.90625 L 310.78125 0.90625 Z M 310.78125 312.1875 ", fillRule: "nonzero" }) }) })] }) }), i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Log in to Shophost" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Don’t have an account?", " ", e(E, { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: xr(n.signUp, l), children: "Sign up" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: i(z, { variant: "secondary", type: "button", className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2", onClick: g, children: [e(ht, { className: "size-4", "aria-hidden": "true" }), "Login with Google"] }) }), e(W, { className: "my-6", children: "or" }), i("form", { onSubmit: d(p), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(pe, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...o("email") }), u.email && e("span", { className: "text-sm text-red-500", children: u.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(pe, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...o("password") }), u.password && e("span", { className: "text-sm text-red-500", children: u.password.message })] })] }), e(z, { type: "submit", isLoading: c, children: c ? "Submitting..." : "Continue" })] })] }), e(W, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: "#", children: "Reset password" })] })] }) });
|
|
1203
|
+
return e(C, { children: i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [e("div", { className: "relative flex items-center justify-center rounded-lg bg-white p-3 shadow-lg ring-1 ring-black/5", children: i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 481, zoomAndPan: "magnify", viewBox: "0 0 360.75 362.250002", height: 483, preserveAspectRatio: "xMidYMid meet", className: "size-8 text-blue-500 dark:text-blue-500", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "2330832e18", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("clipPath", { id: "5855bcb1c8", children: e("path", { d: "M 49 49.945312 L 357 49.945312 L 357 361.257812 L 49 361.257812 Z M 49 49.945312 ", clipRule: "nonzero" }) }), e("clipPath", { id: "2af377de26", children: e("path", { d: "M 226.65625 348.957031 L 345.746094 229.867188 C 359.820312 215.792969 359.820312 193.058594 345.746094 178.984375 L 228.101562 61.339844 C 220.160156 53.398438 209.515625 49.070312 198.328125 49.070312 L 50.730469 49.070312 L 180.644531 178.984375 C 194.71875 193.058594 194.71875 215.792969 180.644531 229.867188 L 49.285156 361.226562 L 196.882812 361.226562 C 208.070312 361.226562 218.71875 356.714844 226.65625 348.957031 Z M 226.65625 348.957031 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", id: "dfad2cd726", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "161eaca8d9", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "5d3dc395e3", children: e("rect", { x: 0, width: 313, y: 0, height: 313 }) }), e("pattern", { id: "2569dd48be", patternUnits: "userSpaceOnUse", width: 313, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 48.148759, 361.331903)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 313 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#5d3dc395e3)", children: e("g", { mask: "url(#161eaca8d9)", children: e("rect", { x: "-127.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-80.78", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "2302aeb2c7", children: e("path", { d: "M 0.246094 0.90625 L 308 0.90625 L 308 312.21875 L 0.246094 312.21875 Z M 0.246094 0.90625 ", clipRule: "nonzero" }) }), e("clipPath", { id: "d6b3633872", children: e("path", { d: "M 177.617188 299.917969 L 296.707031 180.828125 C 310.78125 166.753906 310.78125 144.019531 296.707031 129.945312 L 179.0625 12.300781 C 171.121094 4.363281 160.476562 0.03125 149.289062 0.03125 L 1.691406 0.03125 L 131.605469 129.945312 C 145.679688 144.019531 145.679688 166.753906 131.605469 180.828125 L 0.246094 312.1875 L 147.84375 312.1875 C 159.03125 312.1875 169.679688 307.675781 177.617188 299.917969 Z M 177.617188 299.917969 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", id: "f9fee20a49", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "8bb974956b", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "4f6b6cd058", children: e("rect", { x: 0, width: 312, y: 0, height: 313 }) }), e("pattern", { id: "80e461df2c", patternUnits: "userSpaceOnUse", width: 312, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 0.247933, 312.433143)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 312 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#4f6b6cd058)", children: e("g", { mask: "url(#8bb974956b)", children: e("rect", { x: "-79.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-129.78", fillOpacity: 1 }) }) }) }) })] }), e("g", { clipPath: "url(#5855bcb1c8)", children: e("g", { clipPath: "url(#2af377de26)", children: e("path", { fill: "url(#2569dd48be)", d: "M 359.820312 361.226562 L 49.289062 361.226562 L 49.289062 49.945312 L 359.820312 49.945312 Z M 359.820312 361.226562 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#2302aeb2c7)", children: e("g", { clipPath: "url(#d6b3633872)", children: e("path", { fill: "url(#80e461df2c)", d: "M 310.78125 312.1875 L 0.25 312.1875 L 0.25 0.90625 L 310.78125 0.90625 Z M 310.78125 312.1875 ", fillRule: "nonzero" }) }) })] }) }), i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Log in to Shophost" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Don’t have an account?", " ", e(E, { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: wr(n.signUp, l), children: "Sign up" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: i(z, { variant: "secondary", type: "button", className: "mt-2 w-full sm:mt-0 shadow-none inline-flex items-center gap-2", onClick: g, children: [e(ht, { className: "size-4", "aria-hidden": "true" }), "Login with Google"] }) }), e(W, { className: "my-6", children: "or" }), i("form", { onSubmit: d(p), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(pe, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...o("email") }), u.email && e("span", { className: "text-sm text-red-500", children: u.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(pe, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...o("password") }), u.password && e("span", { className: "text-sm text-red-500", children: u.password.message })] })] }), e(z, { type: "submit", isLoading: c, children: c ? "Submitting..." : "Continue" })] })] }), e(W, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: "#", children: "Reset password" })] })] }) });
|
|
1204
1204
|
};
|
|
1205
|
-
function
|
|
1206
|
-
const { appearance: t } =
|
|
1205
|
+
function jn({ children: a }) {
|
|
1206
|
+
const { appearance: t } = Gi(), r = t == null ? void 0 : t.loginImage;
|
|
1207
1207
|
return i("div", { className: "flex w-full min-h-screen", children: [r && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(ve, { src: r, alt: "Login Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${r ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: a }) })] });
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1210
|
-
return e(
|
|
1209
|
+
function mc() {
|
|
1210
|
+
return e(jn, { children: e(cc, {}) });
|
|
1211
1211
|
}
|
|
1212
|
-
const
|
|
1213
|
-
const a = _(), t = fe(), r = Fa(), n = K(), { signIn: s, signUp: l } = r, o = Ft(t == null ? void 0 : t.get("redirect"), n), { register: d, handleSubmit: u, formState: { errors: c } } = me({ resolver: ue(
|
|
1214
|
-
return e(C, { children: i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [e("div", { className: "relative flex items-center justify-center rounded-lg bg-white p-3 shadow-lg ring-1 ring-black/5", children: i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 481, zoomAndPan: "magnify", viewBox: "0 0 360.75 362.250002", height: 483, preserveAspectRatio: "xMidYMid meet", className: "size-8 text-blue-500 dark:text-blue-500", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "2330832e18", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("clipPath", { id: "5855bcb1c8", children: e("path", { d: "M 49 49.945312 L 357 49.945312 L 357 361.257812 L 49 361.257812 Z M 49 49.945312 ", clipRule: "nonzero" }) }), e("clipPath", { id: "2af377de26", children: e("path", { d: "M 226.65625 348.957031 L 345.746094 229.867188 C 359.820312 215.792969 359.820312 193.058594 345.746094 178.984375 L 228.101562 61.339844 C 220.160156 53.398438 209.515625 49.070312 198.328125 49.070312 L 50.730469 49.070312 L 180.644531 178.984375 C 194.71875 193.058594 194.71875 215.792969 180.644531 229.867188 L 49.285156 361.226562 L 196.882812 361.226562 C 208.070312 361.226562 218.71875 356.714844 226.65625 348.957031 Z M 226.65625 348.957031 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", id: "dfad2cd726", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "161eaca8d9", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "5d3dc395e3", children: e("rect", { x: 0, width: 313, y: 0, height: 313 }) }), e("pattern", { id: "2569dd48be", patternUnits: "userSpaceOnUse", width: 313, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 48.148759, 361.331903)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 313 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#5d3dc395e3)", children: e("g", { mask: "url(#161eaca8d9)", children: e("rect", { x: "-127.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-80.78", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "2302aeb2c7", children: e("path", { d: "M 0.246094 0.90625 L 308 0.90625 L 308 312.21875 L 0.246094 312.21875 Z M 0.246094 0.90625 ", clipRule: "nonzero" }) }), e("clipPath", { id: "d6b3633872", children: e("path", { d: "M 177.617188 299.917969 L 296.707031 180.828125 C 310.78125 166.753906 310.78125 144.019531 296.707031 129.945312 L 179.0625 12.300781 C 171.121094 4.363281 160.476562 0.03125 149.289062 0.03125 L 1.691406 0.03125 L 131.605469 129.945312 C 145.679688 144.019531 145.679688 166.753906 131.605469 180.828125 L 0.246094 312.1875 L 147.84375 312.1875 C 159.03125 312.1875 169.679688 307.675781 177.617188 299.917969 Z M 177.617188 299.917969 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", id: "f9fee20a49", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "8bb974956b", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "4f6b6cd058", children: e("rect", { x: 0, width: 312, y: 0, height: 313 }) }), e("pattern", { id: "80e461df2c", patternUnits: "userSpaceOnUse", width: 312, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 0.247933, 312.433143)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 312 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#4f6b6cd058)", children: e("g", { mask: "url(#8bb974956b)", children: e("rect", { x: "-79.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-129.78", fillOpacity: 1 }) }) }) }) })] }), e("g", { clipPath: "url(#5855bcb1c8)", children: e("g", { clipPath: "url(#2af377de26)", children: e("path", { fill: "url(#2569dd48be)", d: "M 359.820312 361.226562 L 49.289062 361.226562 L 49.289062 49.945312 L 359.820312 49.945312 Z M 359.820312 361.226562 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#2302aeb2c7)", children: e("g", { clipPath: "url(#d6b3633872)", children: e("path", { fill: "url(#80e461df2c)", d: "M 310.78125 312.1875 L 0.25 312.1875 L 0.25 0.90625 L 310.78125 0.90625 Z M 310.78125 312.1875 ", fillRule: "nonzero" }) }) })] }) }), i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Log in to Shophost" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Already have an account?", " ", e(E, { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: xr(n.signIn, o), children: "Sign in" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: e(z, { asChild: !0, variant: "secondary", className: "mt-2 w-full sm:mt-0", children: i("button", { className: "inline-flex items-center gap-2", onClick: f, children: [e(ht, { className: "size-4", "aria-hidden": "true" }), "Signin with Google"] }) }) }), e(W, { className: "my-6", children: "or" }), i("form", { onSubmit: u((w) => b(w)), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "First Name" }), e(pe, { type: "text", id: "email-form-item", placeholder: "Emily", ...d("firstname") }), c.firstname && e("span", { className: "text-sm text-red-500", children: c.firstname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "Last Name" }), e(pe, { type: "text", id: "email-form-item", placeholder: "Emily", ...d("lastname") }), c.lastname && e("span", { className: "text-sm text-red-500", children: c.lastname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(pe, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...d("email") }), c.email && e("span", { className: "text-sm text-red-500", children: c.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(pe, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...d("password") }), c.password && e("span", { className: "text-sm text-red-500", children: c.password.message })] })] }), g && e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }), e(z, { type: "submit", isLoading: p, children: p ? "Submitting..." : "Continue" })] })] }), e(W, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: "#", children: "Reset password" })] })] }) });
|
|
1212
|
+
const uc = () => {
|
|
1213
|
+
const a = _(), t = fe(), r = Fa(), n = K(), { signIn: s, signUp: l } = r, o = Ft(t == null ? void 0 : t.get("redirect"), n), { register: d, handleSubmit: u, formState: { errors: c } } = me({ resolver: ue(cr), shouldFocusError: !0 }), h = () => a.push(o), { isPending: p, isError: g, mutate: b } = L({ onMutate: async (w) => l.email({ email: w.email, password: w.password, name: `${w.firstname} ${w.lastname}`, firstname: w.firstname, lastname: w.lastname, fetchOptions: { onSuccess: h } }) }), f = async () => s.social({ provider: "google", callbackURL: Ln(window.location.origin, o, n) });
|
|
1214
|
+
return e(C, { children: i("div", { className: "flex w-full flex-col items-start sm:max-w-sm", children: [e("div", { className: "relative flex items-center justify-center rounded-lg bg-white p-3 shadow-lg ring-1 ring-black/5", children: i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 481, zoomAndPan: "magnify", viewBox: "0 0 360.75 362.250002", height: 483, preserveAspectRatio: "xMidYMid meet", className: "size-8 text-blue-500 dark:text-blue-500", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "2330832e18", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("clipPath", { id: "5855bcb1c8", children: e("path", { d: "M 49 49.945312 L 357 49.945312 L 357 361.257812 L 49 361.257812 Z M 49 49.945312 ", clipRule: "nonzero" }) }), e("clipPath", { id: "2af377de26", children: e("path", { d: "M 226.65625 348.957031 L 345.746094 229.867188 C 359.820312 215.792969 359.820312 193.058594 345.746094 178.984375 L 228.101562 61.339844 C 220.160156 53.398438 209.515625 49.070312 198.328125 49.070312 L 50.730469 49.070312 L 180.644531 178.984375 C 194.71875 193.058594 194.71875 215.792969 180.644531 229.867188 L 49.285156 361.226562 L 196.882812 361.226562 C 208.070312 361.226562 218.71875 356.714844 226.65625 348.957031 Z M 226.65625 348.957031 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", id: "dfad2cd726", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "161eaca8d9", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 313, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATkAAAE5CAYAAADr4VfxAAAABmJLR0QA/wD/AP+gvaeTAAAEKklEQVR4nO3UMQqAMBQFQeP9D51aUYSAIssM/CbwSLdj+4dxcXfvT7eys7Gx+Xbz5l8H+/kBoETkgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSBM5IE3kgDSRA9JEDkgTOSBN5IA0kQPSRA5IEzkgTeSANJED0kQOSJsw7gNx2VB9PQAAAABJRU5ErkJggg==", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "5d3dc395e3", children: e("rect", { x: 0, width: 313, y: 0, height: 313 }) }), e("pattern", { id: "2569dd48be", patternUnits: "userSpaceOnUse", width: 313, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 48.148759, 361.331903)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 313 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#5d3dc395e3)", children: e("g", { mask: "url(#161eaca8d9)", children: e("rect", { x: "-127.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-80.78", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "2302aeb2c7", children: e("path", { d: "M 0.246094 0.90625 L 308 0.90625 L 308 312.21875 L 0.246094 312.21875 Z M 0.246094 0.90625 ", clipRule: "nonzero" }) }), e("clipPath", { id: "d6b3633872", children: e("path", { d: "M 177.617188 299.917969 L 296.707031 180.828125 C 310.78125 166.753906 310.78125 144.019531 296.707031 129.945312 L 179.0625 12.300781 C 171.121094 4.363281 160.476562 0.03125 149.289062 0.03125 L 1.691406 0.03125 L 131.605469 129.945312 C 145.679688 144.019531 145.679688 166.753906 131.605469 180.828125 L 0.246094 312.1875 L 147.84375 312.1875 C 159.03125 312.1875 169.679688 307.675781 177.617188 299.917969 Z M 177.617188 299.917969 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", id: "f9fee20a49", height: 313, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "8bb974956b", children: e("g", { filter: "url(#2330832e18)", children: e("g", { children: e("image", { x: 0, y: 0, width: 312, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE5CAYAAAAEIzzPAAAABmJLR0QA/wD/AP+gvaeTAAAEKElEQVR4nO3UMQ6AIAAEQfH/j7bGQhqVZDOT0EAudDuO/cbDWb3bvLf76x8bmy83k/N+AVAhcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2QJHJAlcECWwAFZAgdkCRyQJXBAlsABWQIHZAkckCVwQJbAAVkCB2RdVgkDcV9ZT24AAAAASUVORK5CYII=", height: 313, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "4f6b6cd058", children: e("rect", { x: 0, width: 312, y: 0, height: 313 }) }), e("pattern", { id: "80e461df2c", patternUnits: "userSpaceOnUse", width: 312, patternTransform: "matrix(0.997934, 0, 0, -0.997934, 0.247933, 312.433143)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 312 313", height: 313, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#4f6b6cd058)", children: e("g", { mask: "url(#8bb974956b)", children: e("rect", { x: "-79.777762", width: "520.555524", fill: "#8c52ff", height: "522.72", y: "-129.78", fillOpacity: 1 }) }) }) }) })] }), e("g", { clipPath: "url(#5855bcb1c8)", children: e("g", { clipPath: "url(#2af377de26)", children: e("path", { fill: "url(#2569dd48be)", d: "M 359.820312 361.226562 L 49.289062 361.226562 L 49.289062 49.945312 L 359.820312 49.945312 Z M 359.820312 361.226562 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#2302aeb2c7)", children: e("g", { clipPath: "url(#d6b3633872)", children: e("path", { fill: "url(#80e461df2c)", d: "M 310.78125 312.1875 L 0.25 312.1875 L 0.25 0.90625 L 310.78125 0.90625 Z M 310.78125 312.1875 ", fillRule: "nonzero" }) }) })] }) }), i("div", { className: "mt-6 flex flex-col", children: [e("h1", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: "Log in to Shophost" }), i("p", { className: "mt-1 text-sm text-gray-700 dark:text-gray-300", children: ["Already have an account?", " ", e(E, { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: wr(n.signIn, o), children: "Sign in" })] })] }), i("div", { className: "mt-10 w-full", children: [e("div", { className: "gap-2 sm:flex sm:flex-row sm:items-center", children: e(z, { asChild: !0, variant: "secondary", className: "mt-2 w-full sm:mt-0", children: i("button", { className: "inline-flex items-center gap-2", onClick: f, children: [e(ht, { className: "size-4", "aria-hidden": "true" }), "Signin with Google"] }) }) }), e(W, { className: "my-6", children: "or" }), i("form", { onSubmit: u((w) => b(w)), className: "flex w-full flex-col gap-y-6", children: [i("div", { className: "flex flex-col gap-y-4", children: [i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "First Name" }), e(pe, { type: "text", id: "email-form-item", placeholder: "Emily", ...d("firstname") }), c.firstname && e("span", { className: "text-sm text-red-500", children: c.firstname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "Last Name" }), e(pe, { type: "text", id: "email-form-item", placeholder: "Emily", ...d("lastname") }), c.lastname && e("span", { className: "text-sm text-red-500", children: c.lastname.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "email-form-item", className: "font-medium", children: "Email" }), e(pe, { type: "email", autoComplete: "email", id: "email-form-item", placeholder: "emily.ross@acme.ch", ...d("email") }), c.email && e("span", { className: "text-sm text-red-500", children: c.email.message })] }), i("div", { className: "flex flex-col space-y-2", children: [e(ke, { htmlFor: "password-form-item", className: "font-medium", children: "Password" }), e(pe, { type: "password", autoComplete: "current-password", id: "password-form-item", placeholder: "Password", ...d("password") }), c.password && e("span", { className: "text-sm text-red-500", children: c.password.message })] })] }), g && e("span", { className: "text-sm text-red-500", children: "An error occurred, please try again." }), e(z, { type: "submit", isLoading: p, children: p ? "Submitting..." : "Continue" })] })] }), e(W, {}), i("p", { className: "text-sm text-gray-700 dark:text-gray-300", children: ["Forgot your password?", " ", e("a", { className: "text-blue-500 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-400", href: "#", children: "Reset password" })] })] }) });
|
|
1215
1215
|
};
|
|
1216
|
-
function
|
|
1217
|
-
return e(
|
|
1216
|
+
function pc() {
|
|
1217
|
+
return e(jn, { children: e(uc, {}) });
|
|
1218
1218
|
}
|
|
1219
|
-
const ya = S.forwardRef(({ className: a, asChild: t, ...r }, n) => e(t ?
|
|
1219
|
+
const ya = S.forwardRef(({ className: a, asChild: t, ...r }, n) => e(t ? tr : "div", { ref: n, className: x("relative w-full rounded-xl border p-6 text-left shadow-xs", "bg-white dark:bg-[#090E1A]", "border-gray-200 dark:border-gray-900", a), ...r }));
|
|
1220
1220
|
ya.displayName = "Card";
|
|
1221
1221
|
const Aa = A.forwardRef(({ onClick: a, icon: t, disabled: r, ...n }, s) => {
|
|
1222
1222
|
const l = t;
|
|
@@ -1224,14 +1224,14 @@ const Aa = A.forwardRef(({ onClick: a, icon: t, disabled: r, ...n }, s) => {
|
|
|
1224
1224
|
});
|
|
1225
1225
|
Aa.displayName = "NavigationButton";
|
|
1226
1226
|
function ni({ displayMonth: a, displayIndex: t, enableYearNavigation: r, disableNavigation: n, numberOfMonths: s, startMonth: l, endMonth: o }) {
|
|
1227
|
-
const d =
|
|
1227
|
+
const d = wl(), u = a, c = t ?? 0, h = c <= 0, p = c === s - 1, g = s > 1 && (h || !p), b = s > 1 && (p || !h), f = d.previousMonth, w = d.nextMonth, y = d.goToMonth, k = !l || Oa(u, -1).getTime() >= l.getTime(), v = !o || Oa(u, 1).getTime() <= o.getTime(), N = () => {
|
|
1228
1228
|
!f || !k || y(Oa(u, -1));
|
|
1229
1229
|
}, R = () => {
|
|
1230
1230
|
!w || !v || y(Oa(u, 1));
|
|
1231
1231
|
};
|
|
1232
1232
|
return i("div", { className: "flex items-center justify-between", children: [i("div", { className: "flex items-center gap-1", children: [r && !b && e(Aa, { disabled: n || !f || !k, "aria-label": "Go to previous year", onClick: N, icon: Pi }), !b && e(Aa, { disabled: n || !f, "aria-label": "Go to previous month", onClick: () => f && y(f), icon: Qi })] }), e("div", { role: "presentation", "aria-live": "polite", className: "text-sm font-medium capitalize tabular-nums text-gray-900 dark:text-gray-50", children: q(u, "LLLL yyy") }), i("div", { className: "flex items-center gap-1", children: [!g && e(Aa, { disabled: n || !w, "aria-label": "Go to next month", onClick: () => w && y(w), icon: gt }), r && !g && e(Aa, { disabled: n || !w || !v, "aria-label": "Go to next year", onClick: R, icon: Ti })] })] });
|
|
1233
1233
|
}
|
|
1234
|
-
const
|
|
1234
|
+
const Vn = (a) => {
|
|
1235
1235
|
const t = a.enableYearNavigation ?? !1, r = a.weekStartsOn ?? 1, n = a.numberOfMonths ?? 1, s = a.disableNavigation, l = a.fromMonth ?? (a.fromYear ? new Date(a.fromYear, 0, 1) : void 0), o = a.toMonth ?? (a.toYear ? new Date(a.toYear, 11, 1) : void 0), d = { months: "flex space-y-0", month: "space-y-4 p-3", caption: "p-4", table: "w-full border-collapse space-y-1", head_row: "flex", head_cell: "w-9 font-medium text-sm sm:text-xs text-center text-gray-400 dark:text-gray-600 pb-2", row: "mt-0.5 flex w-full", cell: x("relative p-0 text-center focus-within:relative", "text-gray-900 dark:text-gray-50"), day: x("size-9 rounded text-sm text-gray-900 focus:z-10 dark:text-gray-50", "hover:bg-gray-200 dark:hover:bg-gray-700", ye), day_today: "font-semibold", day_selected: x("rounded", "bg-blue-600 text-gray-50", "dark:bg-blue-500 dark:text-gray-50"), day_disabled: "text-gray-300! dark:text-gray-700! line-through hover:bg-transparent", day_outside: "text-gray-400 dark:text-gray-600", day_range_middle: x("rounded-none!", "bg-gray-100! text-gray-900!", "dark:bg-gray-900! dark:text-gray-50!"), day_range_start: "rounded-r-none rounded-l!", day_range_end: "rounded-l-none rounded-r!", ...a.classNames }, u = { ...a.components, Caption: ({ displayMonth: N, displayIndex: R }) => e(ni, { displayMonth: N, displayIndex: R, enableYearNavigation: t, disableNavigation: s, numberOfMonths: n, startMonth: l, endMonth: o }), Chevron: () => e("span", {}), Nav: () => e("span", {}), MonthCaption: ({ calendarMonth: N, displayIndex: R }) => e(ni, { displayMonth: N.date, displayIndex: R, enableYearNavigation: t, disableNavigation: s, numberOfMonths: n, startMonth: l, endMonth: o }) }, c = { weekStartsOn: r, numberOfMonths: n, disableNavigation: s, showOutsideDays: n === 1, className: x(a.className), classNames: d, components: u };
|
|
1236
1236
|
if (a.mode === "range") {
|
|
1237
1237
|
const { enableYearNavigation: N, className: R, classNames: T, components: D, weekStartsOn: H, numberOfMonths: le, ...B } = a, J = { ...B, ...c, mode: "range" };
|
|
@@ -1248,25 +1248,25 @@ const Zn = (a) => {
|
|
|
1248
1248
|
const { enableYearNavigation: h, className: p, classNames: g, components: b, mode: f, weekStartsOn: w, numberOfMonths: y, ...k } = a, v = { ...k, ...c, mode: "single" };
|
|
1249
1249
|
return e(Va, { ...v });
|
|
1250
1250
|
};
|
|
1251
|
-
|
|
1252
|
-
const
|
|
1251
|
+
Vn.displayName = "Calendar";
|
|
1252
|
+
const hc = () => {
|
|
1253
1253
|
const a = typeof window < "u" ? window.navigator.language : "en-US", t = new Intl.DateTimeFormat(a, { hour: "numeric" }).format();
|
|
1254
1254
|
return Number.isInteger(Number(t));
|
|
1255
|
-
},
|
|
1256
|
-
const r = A.useRef(null), { segmentProps: n } =
|
|
1255
|
+
}, gc = ({ segment: a, state: t }) => {
|
|
1256
|
+
const r = A.useRef(null), { segmentProps: n } = yl(a, t, r), s = a.type === "literal" && a.text === ":", l = a.type === "literal" && a.text === " ";
|
|
1257
1257
|
return i("div", { ...n, ref: r, className: X("relative block w-full appearance-none rounded-md border px-2.5 py-1.5 text-left uppercase tabular-nums shadow-xs outline-hidden transition sm:text-sm", "border-gray-300 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", fa, "invalid:border-red-500 invalid:ring-2 invalid:ring-red-200 group-aria-invalid/time-input:border-red-500 group-aria-invalid/time-input:ring-2 group-aria-invalid/time-input:ring-red-200 dark:group-aria-invalid/time-input:ring-red-400/20", { "w-fit! border-none bg-transparent px-0 text-gray-400 shadow-none": s || l, hidden: l, "border-gray-300 bg-gray-100 text-gray-400 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-500": t.isDisabled, "bg-transparent! text-gray-400!": !a.isEditable }), children: [e("span", { "aria-hidden": "true", className: X("pointer-events-none block w-full text-left text-gray-700 sm:text-sm", { hidden: !a.isPlaceholder, "h-0": !a.isPlaceholder }), children: a.placeholder }), a.isPlaceholder ? " " : a.text] });
|
|
1258
|
-
},
|
|
1258
|
+
}, $t = A.forwardRef(({ hourCycle: a, ...t }, r) => {
|
|
1259
1259
|
const n = A.useRef(null);
|
|
1260
1260
|
A.useImperativeHandle(r, () => n == null ? void 0 : n.current);
|
|
1261
|
-
const s = window !== void 0 ? window.navigator.language : "en-US", l =
|
|
1262
|
-
return e("div", { ...o, ref: n, className: "group/time-input inline-flex w-full gap-x-2", children: l.segments.map((d, u) => e(
|
|
1261
|
+
const s = window !== void 0 ? window.navigator.language : "en-US", l = bl({ hourCycle: a, locale: s, shouldForceLeadingZeros: !0, autoFocus: !0, ...t }), { fieldProps: o } = fl({ ...t, hourCycle: a, shouldForceLeadingZeros: !0 }, l, n);
|
|
1262
|
+
return e("div", { ...o, ref: n, className: "group/time-input inline-flex w-full gap-x-2", children: l.segments.map((d, u) => e(gc, { segment: d, state: l }, u)) });
|
|
1263
1263
|
});
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1269
|
-
const
|
|
1264
|
+
$t.displayName = "TimeInput";
|
|
1265
|
+
const fc = Le({ base: ["peer flex w-full cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 py-2 shadow-xs outline-hidden transition-all sm:text-sm", "bg-white dark:bg-gray-950", "border-gray-300 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "hover:bg-gray-50 dark:hover:bg-gray-950/50", "disabled:pointer-events-none", "disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-800 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", fa], variants: { hasError: { true: zt } } }), Zn = A.forwardRef(({ className: a, children: t, placeholder: r, hasError: n, ...s }, l) => e(G.Trigger, { asChild: !0, children: i("button", { ref: l, className: X(fc({ hasError: n }), a), ...s, children: [e(_s, { className: "size-5 shrink-0 text-gray-400 dark:text-gray-600" }), e("span", { className: "flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900 dark:text-gray-50", children: t || (r ? e("span", { className: "text-gray-400 dark:text-gray-600", children: r }) : null) })] }) }));
|
|
1266
|
+
Zn.displayName = "DatePicker.Trigger";
|
|
1267
|
+
const Hn = A.forwardRef(({ align: a, className: t, children: r, ...n }, s) => e(G.Portal, { children: e(G.Content, { ref: s, sideOffset: 10, side: "bottom", align: a, avoidCollisions: !0, onOpenAutoFocus: (l) => l.preventDefault(), className: X("relative z-50 w-fit rounded-md border text-sm shadow-xl shadow-black/[2.5%]", "min-w-[calc(var(--radix-select-trigger-width)-2px)] max-w-[95vw]", "border-gray-200 dark:border-gray-800", "bg-white dark:bg-gray-950", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[state=open]:data-[side=bottom]:animate-slideDownAndFade data-[state=open]:data-[side=left]:animate-slideLeftAndFade data-[state=open]:data-[side=right]:animate-slideRightAndFade data-[state=open]:data-[side=top]:animate-slideUpAndFade", t), ...n, children: r }) }));
|
|
1268
|
+
Hn.displayName = "DatePicker.CalendarPopover";
|
|
1269
|
+
const Un = ({ presets: a, onSelect: t, currentValue: r }) => {
|
|
1270
1270
|
const n = (c) => "dateRange" in c, s = (c) => "date" in c, l = (c) => {
|
|
1271
1271
|
n(c) ? t(c.dateRange) : s(c) && t(c.date);
|
|
1272
1272
|
}, o = (c, h) => c.getDate() === h.getDate() && c.getMonth() === h.getMonth() && c.getFullYear() === h.getFullYear(), d = (c, h) => {
|
|
@@ -1288,12 +1288,12 @@ const qn = ({ presets: a, onSelect: t, currentValue: r }) => {
|
|
|
1288
1288
|
};
|
|
1289
1289
|
return e("ul", { className: "flex items-start gap-x-2 sm:flex-col", children: a.map((c, h) => e("li", { className: "sm:w-full sm:py-px", children: e("button", { title: c.label, className: X("relative w-full overflow-hidden text-ellipsis whitespace-nowrap rounded border px-2.5 py-1.5 text-left text-base shadow-xs outline-hidden transition-all sm:border-none sm:py-2 sm:text-sm sm:shadow-none", "text-gray-700 dark:text-gray-300", "border-gray-200 dark:border-gray-800", ye, "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", { "bg-gray-100 dark:bg-gray-900": u(c) }), onClick: () => l(c), "aria-label": `Select ${c.label}`, children: e("span", { children: c.label }) }) }, h)) });
|
|
1290
1290
|
};
|
|
1291
|
-
|
|
1291
|
+
Un.displayName = "DatePicker.PresetContainer";
|
|
1292
1292
|
const si = (a, t, r) => {
|
|
1293
|
-
const n = !
|
|
1293
|
+
const n = !hc();
|
|
1294
1294
|
let s;
|
|
1295
1295
|
return r ? s = n ? q(a, "dd MMM, yyyy h:mm a", { locale: t }) : q(a, "dd MMM, yyyy HH:mm", { locale: t }) : s = q(a, "dd MMM, yyyy", { locale: t }), s;
|
|
1296
|
-
},
|
|
1296
|
+
}, yc = ({ defaultValue: a, value: t, onChange: r, presets: n, disabled: s, disableNavigation: l, disabledDays: o, enableYearNavigation: d = !1, locale: u = xl, showTimePicker: c, placeholder: h = "Select date range", hasError: p, translations: g, align: b = "center", className: f, ...w }) => {
|
|
1297
1297
|
const [y, k] = A.useState(!1), [v, N] = A.useState(t ?? a ?? void 0), [R, T] = A.useState(v == null ? void 0 : v.from), [D, H] = A.useState(t != null && t.from ? new ie(t.from.getHours(), t.from.getMinutes()) : a != null && a.from ? new ie(a.from.getHours(), a.from.getMinutes()) : new ie(0, 0)), [le, B] = A.useState(t != null && t.to ? new ie(t.to.getHours(), t.to.getMinutes()) : a != null && a.to ? new ie(a.to.getHours(), a.to.getMinutes()) : new ie(0, 0)), J = A.useMemo(() => v, [y]);
|
|
1298
1298
|
A.useEffect(() => {
|
|
1299
1299
|
N(t ?? a ?? void 0);
|
|
@@ -1337,8 +1337,8 @@ const si = (a, t, r) => {
|
|
|
1337
1337
|
const va = A.useMemo(() => v ? `${v.from ? si(v.from, u, c) : ""} - ${v.to ? si(v.to, u, c) : ""}` : null, [v, u, c]), Ja = () => {
|
|
1338
1338
|
k(!1), r == null || r(v);
|
|
1339
1339
|
};
|
|
1340
|
-
return i(G.Root, { "tremor-id": "tremor-raw", open: y, onOpenChange: Ta, children: [e(
|
|
1341
|
-
},
|
|
1340
|
+
return i(G.Root, { "tremor-id": "tremor-raw", open: y, onOpenChange: Ta, children: [e(Zn, { placeholder: h, disabled: s, className: f, hasError: p, "aria-required": w.required || w["aria-required"], "aria-invalid": w["aria-invalid"], "aria-label": w["aria-label"], "aria-labelledby": w["aria-labelledby"], children: va }), e(Hn, { align: b, children: e("div", { className: "flex", children: i("div", { className: "flex flex-col overflow-x-auto sm:flex-row sm:items-start", children: [n && n.length > 0 && e("div", { className: X("relative flex h-16 w-full items-center sm:h-full sm:w-40", "border-b border-gray-200 sm:border-b-0 sm:border-r dark:border-gray-800", "overflow-auto"), children: e("div", { className: "absolute px-3 sm:inset-0 sm:left-0 sm:p-2", children: e(Un, { currentValue: v, presets: n, onSelect: Se }) }) }), i("div", { className: "overflow-x-auto", children: [e(Vn, { mode: "range", selected: v, onSelect: Se, month: R, onMonthChange: T, numberOfMonths: 2, disabled: o, disableNavigation: l, enableYearNavigation: d, locale: u, initialFocus: !0, classNames: { months: "flex flex-row divide-x divide-gray-200 dark:divide-gray-800 overflow-x-auto" }, ...w }), c && i("div", { className: "flex items-center justify-evenly gap-x-3 border-t border-gray-200 p-3 dark:border-gray-800", children: [i("div", { className: "flex flex-1 items-center gap-x-2", children: [i("span", { className: "dark:text-gray-30 text-gray-700", children: [(g == null ? void 0 : g.start) ?? "Start", ":"] }), e($t, { value: D, onChange: (te) => ka(te, "start"), "aria-label": "Start date time", isDisabled: !(v != null && v.from), isRequired: w.required })] }), e($s, { className: "size-4 shrink-0 text-gray-400" }), i("div", { className: "flex flex-1 items-center gap-x-2", children: [i("span", { className: "dark:text-gray-30 text-gray-700", children: [(g == null ? void 0 : g.end) ?? "End", ":"] }), e($t, { value: le, onChange: (te) => ka(te, "end"), "aria-label": "End date time", isDisabled: !(v != null && v.to), isRequired: w.required })] })] }), i("div", { className: "border-t border-gray-200 p-3 sm:flex sm:items-center sm:justify-between dark:border-gray-800", children: [i("p", { className: "tabular-nums text-gray-900 dark:text-gray-50", children: [i("span", { className: "text-gray-700 dark:text-gray-300", children: [(g == null ? void 0 : g.range) ?? "Range", ":"] }), " ", e("span", { className: "font-medium", children: va })] }), i("div", { className: "mt-2 flex items-center gap-x-2 sm:mt-0", children: [e(z, { variant: "secondary", className: "h-8 w-full sm:w-fit", type: "button", onClick: wa, children: (g == null ? void 0 : g.cancel) ?? "Cancel" }), e(z, { variant: "primary", className: "h-8 w-full sm:w-fit", type: "button", onClick: Ja, children: (g == null ? void 0 : g.apply) ?? "Apply" })] })] })] })] }) }) })] });
|
|
1341
|
+
}, bc = (a, t) => {
|
|
1342
1342
|
const { toYear: r, fromYear: n, fromMonth: s, toMonth: l, fromDay: o, toDay: d } = t;
|
|
1343
1343
|
if (a && a.length > 0) {
|
|
1344
1344
|
const u = n, c = r;
|
|
@@ -1376,25 +1376,25 @@ const si = (a, t, r) => {
|
|
|
1376
1376
|
}
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
|
-
},
|
|
1380
|
-
|
|
1381
|
-
const
|
|
1382
|
-
function
|
|
1383
|
-
const { client: a } = I(), t = U(), r = S.useMemo(() => /* @__PURE__ */ new Date(), []), [n, s] = S.useState({ from:
|
|
1384
|
-
const y = (n == null ? void 0 : n.from) ??
|
|
1385
|
-
return { from:
|
|
1379
|
+
}, qn = ({ presets: a, ...t }) => (a && bc(a, t), e(yc, { presets: a, ...t }));
|
|
1380
|
+
qn.displayName = "DateRangePicker";
|
|
1381
|
+
const xc = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }), wc = { bank_transfer: "Bank transfer", blik: "BLIK", card: "Card", cash_on_delivery: "Cash on delivery", paypal: "PayPal" }, kc = { delivery: "Delivery", pickup: "Pickup" }, Za = ["#0f766e", "#fb923c"], Ha = (a) => typeof a == "number" ? a : typeof a == "string" ? Number(a) : Array.isArray(a) && a.length > 0 ? Number(a[0]) : 0;
|
|
1382
|
+
function vc() {
|
|
1383
|
+
const { client: a } = I(), t = U(), r = S.useMemo(() => /* @__PURE__ */ new Date(), []), [n, s] = S.useState({ from: Tr(r, 29), to: r }), l = S.useMemo(() => {
|
|
1384
|
+
const y = (n == null ? void 0 : n.from) ?? Tr(r, 29), k = (n == null ? void 0 : n.to) ?? (n == null ? void 0 : n.from) ?? r;
|
|
1385
|
+
return { from: dl(y), to: ol(k) };
|
|
1386
1386
|
}, [n, r]), { data: o, error: d, isError: u, isLoading: c, isRefetching: h, refetch: p } = Q({ queryKey: ["dashboard-overview", t, l.from.toISOString(), l.to.toISOString()], queryFn: async () => {
|
|
1387
1387
|
const { body: y, status: k } = await a.analytics.getOverview({ params: { organizationId: t }, query: { from: l.from.toISOString(), to: l.to.toISOString() } });
|
|
1388
1388
|
if (k !== 200 || !y) throw new Error("Failed to fetch dashboard overview");
|
|
1389
1389
|
return y;
|
|
1390
|
-
}, placeholderData: he }), g = (o == null ? void 0 : o.summary.currency) ?? "USD", b = ((o == null ? void 0 : o.paymentMethods) ?? []).map((y) => ({ ...y, label:
|
|
1391
|
-
return i("section", { "aria-labelledby": "dashboard-overview", children: [i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between", children: [i("div", { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Overview" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: "Live store performance across orders, reservations, and payment behaviour." })] }), i("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center", children: [h ? e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Updating…" }) : null, e(
|
|
1390
|
+
}, placeholderData: he }), g = (o == null ? void 0 : o.summary.currency) ?? "USD", b = ((o == null ? void 0 : o.paymentMethods) ?? []).map((y) => ({ ...y, label: wc[y.method] ?? y.method })), f = ((o == null ? void 0 : o.fulfilmentMethods) ?? []).map((y) => ({ ...y, label: kc[y.method] ?? y.method })), w = f.reduce((y, k) => y + k.count, 0);
|
|
1391
|
+
return i("section", { "aria-labelledby": "dashboard-overview", children: [i("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between", children: [i("div", { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Overview" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: "Live store performance across orders, reservations, and payment behaviour." })] }), i("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center", children: [h ? e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Updating…" }) : null, e(qn, { value: n, onChange: s, className: "w-full sm:w-fit", toDate: r, align: "end" })] })] }), u && !o ? e(ya, { className: "mt-8 border-red-200 dark:border-red-950", children: i("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [i("div", { children: [e("h2", { className: "text-base font-semibold text-gray-900 dark:text-gray-50", children: "Dashboard data unavailable" }), e("p", { className: "mt-1 text-sm text-gray-600 dark:text-gray-400", children: d instanceof Error ? d.message : "We could not load the dashboard metrics for this range." })] }), i(z, { onClick: () => p(), className: "gap-2", children: [e(Gs, { className: "size-4", "aria-hidden": "true" }), "Retry"] })] }) }) : null, e("div", { className: "mt-8 grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-4", children: c && !o ? Array.from({ length: 4 }).map((y, k) => e(Na, { className: "h-[148px]" }, k)) : o ? i(C, { children: [e(Ua, { icon: Ks, title: "Paid sales", value: ne.currency(o.summary.totalSales, g), description: "Successful payments in the selected range" }), e(Ua, { icon: Ys, title: "Paid orders", value: ne.unit(o.summary.paidOrders), description: `Average order value ${ne.currency(o.summary.averageOrderValue, g)}` }), e(Ua, { icon: Xs, title: "Reservations", value: ne.unit(o.summary.reservations), description: "Scheduled reservations in the selected range" }), e(Ua, { icon: el, title: "Reserved guests", value: ne.unit(o.summary.guests), description: "Total covers booked from reservations" })] }) : null }), e("div", { className: "mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2", children: c && !o ? i(C, { children: [e(Na, { className: "h-[360px]" }), e(Na, { className: "h-[360px]" })] }) : o ? i(C, { children: [e(qa, { title: "Paid sales by day", value: ne.currency(o.summary.totalSales, g), description: "Gross paid revenue recognised on each order day.", children: e(La, { width: "100%", height: "100%", children: i(ml, { data: o.salesByDay, children: [e("defs", { children: i("linearGradient", { id: "salesGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [e("stop", { offset: "5%", stopColor: "#0f766e", stopOpacity: 0.28 }), e("stop", { offset: "95%", stopColor: "#0f766e", stopOpacity: 0.02 })] }) }), e(Ot, { strokeDasharray: "3 3", stroke: "#e5e7eb", vertical: !1 }), e(Lt, { dataKey: "label", axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(jt, { axisLine: !1, tickLine: !1, width: 48, tickFormatter: (y) => xc.format(y), tick: { fill: "#6b7280", fontSize: 12 } }), e(ja, { formatter: (y, k) => {
|
|
1392
1392
|
const v = Ha(y);
|
|
1393
1393
|
return [String(k) === "totalSales" ? ne.currency(v, g) : ne.unit(v), String(k) === "totalSales" ? "Sales" : "Paid orders"];
|
|
1394
|
-
}, contentStyle: Wa, labelStyle: _a }), e(
|
|
1394
|
+
}, contentStyle: Wa, labelStyle: _a }), e(ul, { type: "monotone", dataKey: "totalSales", stroke: "#0f766e", strokeWidth: 2.5, fill: "url(#salesGradient)", name: "totalSales" })] }) }) }), e(qa, { title: "Reservations per day", value: ne.unit(o.summary.reservations), description: "Bookings are grouped by reservation date, not submission time.", children: e(La, { width: "100%", height: "100%", children: i(Jr, { data: o.reservationsByDay, children: [e(Ot, { strokeDasharray: "3 3", stroke: "#e5e7eb", vertical: !1 }), e(Lt, { dataKey: "label", axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(jt, { allowDecimals: !1, axisLine: !1, tickLine: !1, width: 36, tick: { fill: "#6b7280", fontSize: 12 } }), e(ja, { formatter: (y, k) => [ne.unit(Ha(y)), String(k) === "guests" ? "Guests" : "Reservations"], contentStyle: Wa, labelStyle: _a }), e(Or, { dataKey: "reservations", name: "reservations", fill: "#fb923c", radius: [8, 8, 0, 0] })] }) }) })] }) : null }), e("div", { className: "mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2", children: c && !o ? i(C, { children: [e(Na, { className: "h-[320px]" }), e(Na, { className: "h-[320px]" })] }) : o ? i(C, { children: [e(qa, { title: "Payment methods", value: ne.unit(b.reduce((y, k) => y + k.count, 0)), description: "Successful orders grouped by how guests paid.", children: b.length > 0 ? e(La, { width: "100%", height: "100%", children: i(Jr, { data: b, layout: "vertical", margin: { left: 12, right: 12 }, children: [e(Ot, { strokeDasharray: "3 3", stroke: "#e5e7eb", horizontal: !1 }), e(Lt, { type: "number", allowDecimals: !1, axisLine: !1, tickLine: !1, tick: { fill: "#6b7280", fontSize: 12 } }), e(jt, { dataKey: "label", type: "category", axisLine: !1, tickLine: !1, width: 110, tick: { fill: "#374151", fontSize: 12 } }), e(ja, { formatter: (y, k, v) => {
|
|
1395
1395
|
const N = Ha(y), R = v && typeof v == "object" && "payload" in v ? v.payload : { totalSales: 0 };
|
|
1396
1396
|
return String(k) === "count" ? [ne.unit(N), "Orders"] : [ne.currency(R.totalSales, g), "Sales"];
|
|
1397
|
-
}, contentStyle: Wa, labelStyle: _a }), e(
|
|
1397
|
+
}, contentStyle: Wa, labelStyle: _a }), e(Or, { dataKey: "count", name: "count", fill: "#2563eb", radius: [0, 8, 8, 0] })] }) }) : e(li, { message: "No paid orders in the selected range." }) }), e(qa, { title: "Fulfilment mix", value: ne.unit(w), description: "Non-cancelled orders split by delivery and pickup.", children: w > 0 ? i("div", { className: "grid h-full grid-cols-1 gap-4 md:grid-cols-[1.2fr_0.8fr]", children: [e(La, { width: "100%", height: "100%", children: i(pl, { children: [e(hl, { data: f, dataKey: "count", nameKey: "label", innerRadius: 68, outerRadius: 100, paddingAngle: 4, children: f.map((y, k) => e(gl, { fill: Za[k % Za.length] }, y.method)) }), e(ja, { formatter: (y, k, v) => {
|
|
1398
1398
|
const N = Ha(y), R = v && typeof v == "object" && "payload" in v ? v.payload : { label: "Orders" };
|
|
1399
1399
|
return [`${ne.unit(N)} orders`, R.label];
|
|
1400
1400
|
}, contentStyle: Wa, labelStyle: _a })] }) }), e("div", { className: "flex flex-col justify-center gap-3", children: f.map((y, k) => i("div", { className: "rounded-lg border border-gray-200 p-4 dark:border-gray-800", children: [i("div", { className: "flex items-center justify-between", children: [i("div", { className: "flex items-center gap-2", children: [e("span", { className: "size-2.5 rounded-full", style: { backgroundColor: Za[k % Za.length] } }), e("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: y.label })] }), i("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: [Math.round(y.count / w * 100), "%"] })] }), e("div", { className: "mt-2 text-lg font-semibold text-gray-900 dark:text-gray-50", children: ne.unit(y.count) }), e("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: ne.currency(y.totalSales, g) })] }, y.method)) })] }) : e(li, { message: "No orders in the selected range." }) })] }) : null })] });
|
|
@@ -1411,7 +1411,7 @@ function Na({ className: a }) {
|
|
|
1411
1411
|
function li({ message: a }) {
|
|
1412
1412
|
return e("div", { className: "flex h-full items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50 text-sm text-gray-500 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-400", children: a });
|
|
1413
1413
|
}
|
|
1414
|
-
const Wa = { border: "1px solid #e5e7eb", borderRadius: "12px", boxShadow: "0 10px 30px rgba(15, 23, 42, 0.08)", backgroundColor: "#ffffff" }, _a = { color: "#111827", fontWeight: 600 },
|
|
1414
|
+
const Wa = { border: "1px solid #e5e7eb", borderRadius: "12px", boxShadow: "0 10px 30px rgba(15, 23, 42, 0.08)", backgroundColor: "#ffffff" }, _a = { color: "#111827", fontWeight: 600 }, Wn = (a, t, r) => {
|
|
1415
1415
|
if (a == null) return r;
|
|
1416
1416
|
const n = Array.isArray(t) ? t : t.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
|
|
1417
1417
|
let s = a;
|
|
@@ -1423,15 +1423,15 @@ const Wa = { border: "1px solid #e5e7eb", borderRadius: "12px", boxShadow: "0 10
|
|
|
1423
1423
|
return s === void 0 ? r : s;
|
|
1424
1424
|
}, oi = [{ continent: "America", items: [{ value: "US", label: "United States", flag: "🇺🇸" }, { value: "CA", label: "Canada", flag: "🇨🇦" }, { value: "MX", label: "Mexico", flag: "🇲🇽" }, { value: "BR", label: "Brazil", flag: "🇧🇷" }, { value: "AR", label: "Argentina", flag: "🇦🇷" }, { value: "CO", label: "Colombia", flag: "🇨🇴" }, { value: "CL", label: "Chile", flag: "🇨🇱" }, { value: "PE", label: "Peru", flag: "🇵🇪" }] }, { continent: "Europe", items: [{ value: "GB", label: "United Kingdom", flag: "🇬🇧" }, { value: "FR", label: "France", flag: "🇫🇷" }, { value: "DE", label: "Germany", flag: "🇩🇪" }, { value: "PL", label: "Poland", flag: "🇵🇱" }, { value: "IT", label: "Italy", flag: "🇮🇹" }, { value: "ES", label: "Spain", flag: "🇪🇸" }, { value: "NL", label: "Netherlands", flag: "🇳🇱" }, { value: "PT", label: "Portugal", flag: "🇵🇹" }, { value: "SE", label: "Sweden", flag: "🇸🇪" }, { value: "NO", label: "Norway", flag: "🇳🇴" }, { value: "DK", label: "Denmark", flag: "🇩🇰" }, { value: "FI", label: "Finland", flag: "🇫🇮" }, { value: "CH", label: "Switzerland", flag: "🇨🇭" }, { value: "IE", label: "Ireland", flag: "🇮🇪" }, { value: "BE", label: "Belgium", flag: "🇧🇪" }, { value: "AT", label: "Austria", flag: "🇦🇹" }, { value: "GR", label: "Greece", flag: "🇬🇷" }] }, { continent: "Asia", items: [{ value: "CN", label: "China", flag: "🇨🇳" }, { value: "JP", label: "Japan", flag: "🇯🇵" }, { value: "IN", label: "India", flag: "🇮🇳" }, { value: "KR", label: "South Korea", flag: "🇰🇷" }, { value: "SG", label: "Singapore", flag: "🇸🇬" }, { value: "MY", label: "Malaysia", flag: "🇲🇾" }, { value: "ID", label: "Indonesia", flag: "🇮🇩" }, { value: "TH", label: "Thailand", flag: "🇹🇭" }, { value: "VN", label: "Vietnam", flag: "🇻🇳" }, { value: "AE", label: "United Arab Emirates", flag: "🇦🇪" }, { value: "SA", label: "Saudi Arabia", flag: "🇸🇦" }] }, { continent: "Oceania", items: [{ value: "AU", label: "Australia", flag: "🇦🇺" }, { value: "NZ", label: "New Zealand", flag: "🇳🇿" }, { value: "FJ", label: "Fiji", flag: "🇫🇯" }, { value: "PG", label: "Papua New Guinea", flag: "🇵🇬" }] }, { continent: "Africa", items: [{ value: "ZA", label: "South Africa", flag: "🇿🇦" }, { value: "NG", label: "Nigeria", flag: "🇳🇬" }, { value: "MA", label: "Morocco", flag: "🇲🇦" }, { value: "EG", label: "Egypt", flag: "🇪🇬" }, { value: "KE", label: "Kenya", flag: "🇰🇪" }, { value: "GH", label: "Ghana", flag: "🇬🇭" }, { value: "ET", label: "Ethiopia", flag: "🇪🇹" }] }], Rt = (a) => e($.Root, { ...a });
|
|
1425
1425
|
Rt.displayName = "Dialog";
|
|
1426
|
-
const
|
|
1427
|
-
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
const Bt = S.forwardRef(({ className: a, ...t }, r) => e(
|
|
1426
|
+
const _n = $.Trigger;
|
|
1427
|
+
_n.displayName = "DialogTrigger";
|
|
1428
|
+
const $n = $.Close;
|
|
1429
|
+
$n.displayName = "DialogClose";
|
|
1430
|
+
const Gn = $.Portal;
|
|
1431
|
+
Gn.displayName = "DialogPortal";
|
|
1432
|
+
const Kn = S.forwardRef(({ className: a, ...t }, r) => e($.Overlay, { ref: r, className: x("fixed inset-0 z-50 overflow-y-auto", "bg-black/70", "data-[state=open]:animate-dialogOverlayShow", a), ...t }));
|
|
1433
|
+
Kn.displayName = "DialogOverlay";
|
|
1434
|
+
const Bt = S.forwardRef(({ className: a, ...t }, r) => e(Gn, { children: e(Kn, { children: e($.Content, { ref: r, className: x("fixed left-1/2 top-1/2 z-50 w-[95vw] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-md border p-6 shadow-lg", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=open]:animate-dialogContentShow", ye, a), ...t }) }) }));
|
|
1435
1435
|
Bt.displayName = "DialogContent";
|
|
1436
1436
|
const Mt = ({ className: a, ...t }) => e("div", { className: x("flex flex-col gap-y-1", a), ...t });
|
|
1437
1437
|
Mt.displayName = "DialogHeader";
|
|
@@ -1439,41 +1439,41 @@ const Pt = S.forwardRef(({ className: a, ...t }, r) => e($.Title, { ref: r, clas
|
|
|
1439
1439
|
Pt.displayName = "DialogTitle";
|
|
1440
1440
|
const Qt = S.forwardRef(({ className: a, ...t }, r) => e($.Description, { ref: r, className: x("text-gray-500 dark:text-gray-500", a), ...t }));
|
|
1441
1441
|
Qt.displayName = "DialogDescription";
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
const
|
|
1451
|
-
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1442
|
+
const kr = A.forwardRef(({ className: a, ...t }, r) => e(Z, { ref: r, className: x("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", a), ...t }));
|
|
1443
|
+
kr.displayName = Z.displayName;
|
|
1444
|
+
const vr = A.forwardRef(({ className: a, ...t }, r) => i("div", { className: "flex items-center border-b pl-3", "cmdk-input-wrapper": "", children: [e(Kt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), e(Z.Input, { ref: r, className: x("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", a), ...t })] }));
|
|
1445
|
+
vr.displayName = Z.Input.displayName;
|
|
1446
|
+
const Nr = A.forwardRef(({ className: a, ...t }, r) => e(Z.List, { ref: r, className: x("max-h-[300px] overflow-y-auto overflow-x-hidden", a), ...t }));
|
|
1447
|
+
Nr.displayName = Z.List.displayName;
|
|
1448
|
+
const Ar = A.forwardRef((a, t) => e(Z.Empty, { ref: t, className: "py-6 text-center text-sm", ...a }));
|
|
1449
|
+
Ar.displayName = Z.Empty.displayName;
|
|
1450
|
+
const Cr = A.forwardRef(({ className: a, ...t }, r) => e(Z.Group, { ref: r, className: x("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", a), ...t }));
|
|
1451
|
+
Cr.displayName = Z.Group.displayName;
|
|
1452
|
+
const Nc = A.forwardRef(({ className: a, ...t }, r) => e(Z.Separator, { ref: r, className: x("-mx-1 h-px bg-border", a), ...t }));
|
|
1453
|
+
Nc.displayName = Z.Separator.displayName;
|
|
1454
|
+
const Sr = A.forwardRef(({ className: a, ...t }, r) => e(Z.Item, { ref: r, className: x("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", a), ...t }));
|
|
1455
|
+
Sr.displayName = Z.Item.displayName;
|
|
1456
|
+
const Ir = (a) => e(G.Root, { ...a });
|
|
1457
|
+
Ir.displayName = "Popover";
|
|
1458
|
+
const Er = A.forwardRef((a, t) => e(G.Trigger, { ref: t, ...a }));
|
|
1459
|
+
Er.displayName = "PopoverTrigger";
|
|
1460
|
+
const Ac = A.forwardRef((a, t) => e(G.Anchor, { ref: t, ...a }));
|
|
1461
|
+
Ac.displayName = "PopoverAnchor";
|
|
1462
|
+
const Cc = A.forwardRef((a, t) => e(G.Close, { ref: t, ...a }));
|
|
1463
|
+
Cc.displayName = "PopoverClose";
|
|
1464
|
+
const zr = A.forwardRef(({ className: a, sideOffset: t = 10, side: r = "bottom", align: n = "center", collisionPadding: s, ...l }, o) => e(G.Portal, { children: e(G.Content, { ref: o, sideOffset: t, side: r, align: n, collisionPadding: s, avoidCollisions: !0, className: X("max-h-[var(--radix-popper-available-height)] min-w-60 overflow-hidden rounded-md border p-2.5 text-sm shadow-md", "border-gray-200 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "bg-white dark:bg-gray-950", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[state=open]:data-[side=bottom]:animate-slideDownAndFade data-[state=open]:data-[side=left]:animate-slideLeftAndFade data-[state=open]:data-[side=right]:animate-slideRightAndFade data-[state=open]:data-[side=top]:animate-slideUpAndFade", a), onWheel: (d) => {
|
|
1465
1465
|
d.stopPropagation(), d.deltaY > 0 ? d.currentTarget.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowDown" })) : d.currentTarget.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowUp" }));
|
|
1466
1466
|
}, ...l }) }));
|
|
1467
|
-
|
|
1468
|
-
const
|
|
1467
|
+
zr.displayName = "PopoverContent";
|
|
1468
|
+
const Sc = ({ value: a, onChange: t }) => {
|
|
1469
1469
|
const r = Fe(), [n, s] = F(!1), l = oi.map((o) => o.items.find((d) => d.value === a)).filter(Boolean)[0];
|
|
1470
|
-
return e("div", { className: "mt-2", children: i(
|
|
1470
|
+
return e("div", { className: "mt-2", children: i(Ir, { open: n, onOpenChange: s, children: [e(Er, { asChild: !0, children: i(z, { id: r, role: "combobox", "aria-expanded": n, variant: "secondary", className: "w-full justify-between shadow-xs! bg-background px-3 py-2.5 font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", children: [a ? i("span", { className: "flex min-w-0 items-center gap-2", children: [e("span", { className: "text-lg leading-none", children: l == null ? void 0 : l.flag }), e("span", { className: "truncate", children: l == null ? void 0 : l.label })] }) : e("span", { className: "text-muted-foreground", children: "Select country" }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(zr, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50", align: "start", children: i(kr, { className: "p-0", children: [e(vr, { className: "w-full border-none", style: { boxShadow: "none" }, placeholder: "Search country..." }), i(Nr, { children: [e(Ar, { children: "No country found." }), oi.map((o) => e(ca, { children: e(Cr, { heading: o.continent, children: o.items.map((d) => i(Sr, { value: d.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => {
|
|
1471
1471
|
t(d.value ?? ""), s(!1);
|
|
1472
1472
|
}, children: [e("span", { className: "text-lg leading-none", children: d.flag }), " ", d.label, a === d.value && e(Ea, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, d.value)) }) }, o.continent))] })] }) })] }) });
|
|
1473
|
-
},
|
|
1473
|
+
}, Ic = ({ ...a }) => {
|
|
1474
1474
|
const t = Fe();
|
|
1475
|
-
return e("div", { className: "mt-2", children: i("div", { className: "relative", children: [e(pe, { id: t, type: "email", inputClassName: "peer ps-9", ...a }), e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: e(
|
|
1476
|
-
},
|
|
1475
|
+
return e("div", { className: "mt-2", children: i("div", { className: "relative", children: [e(pe, { id: t, type: "email", inputClassName: "peer ps-9", ...a }), e("div", { className: "pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-muted-foreground/80 peer-disabled:opacity-50", children: e(Ts, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })] }) });
|
|
1476
|
+
}, Ec = (a) => {
|
|
1477
1477
|
const { client: t } = I(), [r, n] = F(!1), [s, l] = F(0), o = async (c) => {
|
|
1478
1478
|
const { body: h, status: p } = await t.file.createTemporaryFile({ body: { filename: c.name, mimeType: c.type, size: c.size, organizationId: a.organizationId } });
|
|
1479
1479
|
if (p !== 201) throw new Error("Failed to create temporary file");
|
|
@@ -1511,17 +1511,17 @@ const Cc = ({ value: a, onChange: t }) => {
|
|
|
1511
1511
|
}
|
|
1512
1512
|
return i("div", { className: "group flex relative flex-col items-center justify-center cursor-pointer w-full h-40 border-2 border-gray-200 border-dashed transition-all rounded-lg hover:bg-gray-100 hover:border-gray-300", children: [e("div", { className: "flex flex-col items-center justify-center", children: r ? i(C, { children: [e("svg", { className: "animate-spin w-4 h-4 fill-current shrink-0 mb-2", viewBox: "0 0 16 16", children: e("path", { d: "M8 16a7.928 7.928 0 01-3.428-.77l.857-1.807A6.006 6.006 0 0014 8c0-3.309-2.691-6-6-6a6.006 6.006 0 00-5.422 8.572l-1.806.859A7.929 7.929 0 010 8c0-4.411 3.589-8 8-8s8 3.589 8 8-3.589 8-8 8z" }) }), i("span", { className: "text-sm", children: ["Uploading... (", s, "%)"] })] }) : i(C, { children: [e(Ya, { className: "w-12 h-12 text-gray-300 group-hover:text-gray-600 transition-all stroke-1" }), e("p", { className: "pt-1 text-sm font-medium text-gray-400 group-hover:text-gray-600", children: "Upload an image" })] }) }), e("input", { type: "file", className: "opacity-0 w-full h-full absolute cursor-pointer", onChange: d, accept: "image/png, image/gif, image/jpeg" })] }, "upload-placeholder");
|
|
1513
1513
|
})() });
|
|
1514
|
-
},
|
|
1515
|
-
|
|
1516
|
-
const
|
|
1514
|
+
}, Yn = ui(({ ...a }, t) => e(pe, { ...a, inputClassName: "border-l-0 rounded-l-none", ref: t, className: "" }));
|
|
1515
|
+
Yn.displayName = "PhoneInput";
|
|
1516
|
+
const zc = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { className: "relative inline-flex items-center self-stretch rounded-s-lg border border-gray-200 dark:border-gray-800 bg-background py-2 pe-2 ps-3 text-muted-foreground transition-shadow focus-within:z-10 focus-within:border-ring focus-within:outline-hidden focus-within:ring-[3px] focus-within:ring-ring/20 hover:bg-accent hover:text-foreground has-disabled:pointer-events-none has-disabled:opacity-50", children: [i("div", { className: "inline-flex items-center gap-1", "aria-hidden": "true", children: [e(Xn, { country: t, countryName: t, "aria-hidden": "true" }), e("span", { className: "text-muted-foreground/80", children: e(na, { size: 16, strokeWidth: 2, "aria-hidden": "true" }) })] }), i("select", { disabled: a, value: t, onChange: (s) => {
|
|
1517
1517
|
r(s.target.value);
|
|
1518
|
-
}, className: "absolute inset-0 text-sm opacity-0", "aria-label": "Select country", children: [e("option", { value: "", children: "Select a country" }, "default"), n.filter((s) => s.value).map((s, l) => i("option", { value: s.value, children: [s.label, " ", s.value && `+${bt.getCountryCallingCode(s.value)}`] }, s.value ?? `empty-${l}`))] })] }),
|
|
1518
|
+
}, className: "absolute inset-0 text-sm opacity-0", "aria-label": "Select country", children: [e("option", { value: "", children: "Select a country" }, "default"), n.filter((s) => s.value).map((s, l) => i("option", { value: s.value, children: [s.label, " ", s.value && `+${bt.getCountryCallingCode(s.value)}`] }, s.value ?? `empty-${l}`))] })] }), Xn = ({ country: a, countryName: t }) => {
|
|
1519
1519
|
const r = Ui[a];
|
|
1520
1520
|
return e("span", { className: "w-5 overflow-hidden rounded-sm", children: r ? e(r, { title: t }) : e(yi, { size: 16, "aria-hidden": "true" }) });
|
|
1521
|
-
},
|
|
1521
|
+
}, Dc = ({ value: a, onChange: t, onBlur: r }) => {
|
|
1522
1522
|
const n = Fe();
|
|
1523
|
-
return e("div", { className: "mt-2", children: e(bt.default, { id: n, className: "flex rounded-lg shadow-xs shadow-black/5", international: !0, flagComponent:
|
|
1524
|
-
},
|
|
1523
|
+
return e("div", { className: "mt-2", children: e(bt.default, { id: n, className: "flex rounded-lg shadow-xs shadow-black/5", international: !0, flagComponent: Xn, countrySelectComponent: zc, inputComponent: Yn, placeholder: "Enter phone number", value: a, onChange: (s) => t(s ?? ""), onBlur: r }) });
|
|
1524
|
+
}, Fc = ({ options: a, value: t, onChange: r, multiple: n = !1, placeholder: s }) => {
|
|
1525
1525
|
var h;
|
|
1526
1526
|
const l = Fe(), [o, d] = F(!1), u = (p) => {
|
|
1527
1527
|
if (n) {
|
|
@@ -1534,68 +1534,68 @@ const Ec = ({ disabled: a, value: t, onChange: r, options: n }) => i("div", { cl
|
|
|
1534
1534
|
r(g);
|
|
1535
1535
|
}
|
|
1536
1536
|
};
|
|
1537
|
-
return e("div", { className: "mt-2", children: i(
|
|
1537
|
+
return e("div", { className: "mt-2", children: i(Ir, { open: o, onOpenChange: d, children: [e(Er, { asChild: !0, children: i(z, { id: l, role: "combobox", "aria-expanded": o, variant: "secondary", className: "w-full justify-between shadow-xs! bg-background px-2! py-1 min-h-[41.6px] font-normal outline-offset-0 hover:bg-background focus-visible:border-ring focus-visible:outline-[3px] focus-visible:outline-ring/20", children: [(t == null ? void 0 : t.length) > 0 ? e("div", { className: "flex flex-wrap gap-2", children: Array.isArray(t) ? t.map((p) => {
|
|
1538
1538
|
const g = a.find((b) => b.value === p);
|
|
1539
1539
|
return g ? i("span", { className: "animate-fadeIn relative inline-flex cursor-default items-center rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-secondary-foreground transition-all hover:bg-background disabled:cursor-not-allowed disabled:opacity-50", children: [g.label, e(za, { size: 12, onClick: (b) => {
|
|
1540
1540
|
b.preventDefault(), c(p);
|
|
1541
1541
|
}, className: "cursor-pointer ml-1" })] }, p) : null;
|
|
1542
|
-
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((p) => p.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(
|
|
1543
|
-
},
|
|
1544
|
-
const { root: s, thumb: l } =
|
|
1542
|
+
}) : e("span", { className: "px-1 text-sm", children: (h = a.find((p) => p.value === t)) == null ? void 0 : h.label }) }) : e("span", { className: "px-1 text-sm text-gray-400", children: s || (n ? "Select options" : "Select an option") }), e(na, { size: 16, strokeWidth: 2, className: "shrink-0 text-muted-foreground/80", "aria-hidden": "true" })] }) }), e(zr, { className: "w-full min-w-[var(--radix-popper-anchor-width)] border-input -mt-1 z-50 p-0", align: "start", children: i(kr, { className: "p-0", children: [e(vr, { className: "w-full border-none pl-0", style: { boxShadow: "none" }, placeholder: "Search..." }), i(Nr, { children: [e(Ar, { children: "No options found." }), e(Cr, { children: a.map((p) => i(Sr, { value: p.label, className: "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800", onSelect: () => u(p.value), children: [p.label, (n ? t.includes(p.value) : t === p.value) && e(Ea, { size: 16, strokeWidth: 2, className: "ml-auto" })] }, p.value)) })] })] }) })] }) });
|
|
1543
|
+
}, Rc = Le({ slots: { root: ["group relative isolate inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5 shadow-inner outline-hidden ring-1 ring-inset transition-all", "bg-gray-200 dark:bg-gray-950", "ring-black/5 dark:ring-gray-800", "data-[state=checked]:bg-blue-600 dark:data-[state=checked]:bg-blue-600", "data-disabled:cursor-default", "data-disabled:data-[state=checked]:bg-blue-200", "data-disabled:data-[state=checked]:ring-gray-300", "dark:data-disabled:data-[state=checked]:ring-gray-900", "dark:data-disabled:data-[state=checked]:bg-blue-900", "data-disabled:data-[state=unchecked]:ring-gray-300", "data-disabled:data-[state=unchecked]:bg-gray-100", "dark:data-disabled:data-[state=unchecked]:ring-gray-700", "dark:data-disabled:data-[state=unchecked]:bg-gray-800", ye], thumb: ["pointer-events-none relative inline-block transform appearance-none rounded-full border-none shadow-lg outline-hidden transition-all duration-150 ease-in-out focus:border-none focus:outline-hidden focus:outline-transparent", "bg-white dark:bg-gray-50", "group-data-disabled:shadow-none", "group-data-disabled:bg-gray-50 dark:group-data-disabled:bg-gray-500"] }, variants: { size: { default: { root: "h-7 w-14", thumb: "h-4 w-4 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0" }, small: { root: "h-4 w-7", thumb: "h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0" } } }, defaultVariants: { size: "default" } }), es = S.forwardRef(({ className: a, size: t, ...r }, n) => {
|
|
1544
|
+
const { root: s, thumb: l } = Rc({ size: t });
|
|
1545
1545
|
return e(et.Root, { ref: n, className: x(s(), a), ...r, children: e(et.Thumb, { className: x(l()) }) });
|
|
1546
1546
|
});
|
|
1547
|
-
|
|
1548
|
-
const
|
|
1547
|
+
es.displayName = "Switch";
|
|
1548
|
+
const Bc = ({ name: a, type: t, placeholder: r, multiple: n, options: s, prefix: l }) => {
|
|
1549
1549
|
const { watch: o, register: d, setFocus: u, setValue: c } = fi();
|
|
1550
1550
|
switch (t) {
|
|
1551
1551
|
case "email":
|
|
1552
|
-
return e(
|
|
1552
|
+
return e(Ic, { ...d(a), placeholder: r });
|
|
1553
1553
|
case "file":
|
|
1554
|
-
return e(
|
|
1554
|
+
return e(Ec, { value: o(a), multiple: n, onChange: (h) => c(a, h) });
|
|
1555
1555
|
case "phone-number":
|
|
1556
|
-
return e(
|
|
1556
|
+
return e(Dc, { value: o("phone"), onChange: (h) => c("phone", h), onBlur: () => u("phone") });
|
|
1557
1557
|
case "country":
|
|
1558
|
-
return e(
|
|
1558
|
+
return e(Sc, { value: o(a), onChange: (h) => c(a, h) });
|
|
1559
1559
|
case "select": {
|
|
1560
1560
|
const h = n ? o(a) || [] : o(a) || "";
|
|
1561
1561
|
if (!s) throw new Error("Options are required for select input");
|
|
1562
|
-
return e(
|
|
1562
|
+
return e(Fc, { options: s, value: h, onChange: (p) => c(a, p), placeholder: r, multiple: n });
|
|
1563
1563
|
}
|
|
1564
1564
|
case "switch":
|
|
1565
|
-
return e(
|
|
1565
|
+
return e(es, { size: "default", className: "mr-2", checked: o(a), onCheckedChange: (h) => c(a, h) });
|
|
1566
1566
|
case "time":
|
|
1567
|
-
return e(
|
|
1567
|
+
return e(Sn, { value: o(a), onChange: (h) => c(a, h.target.value), className: "mt-2" });
|
|
1568
1568
|
default:
|
|
1569
1569
|
return e(pe, { ...d(a), type: t, rows: t === "textarea" ? 4 : void 0, placeholder: r, className: "mt-2", prefix: l });
|
|
1570
1570
|
}
|
|
1571
|
-
},
|
|
1571
|
+
}, Mc = (a, t) => !a || typeof a != "object" ? void 0 : t ? t.replace(/\[/g, ".").replace(/\]/g, "").split(".").filter(Boolean).reduce((r, n) => {
|
|
1572
1572
|
if (r != null) return r[n];
|
|
1573
1573
|
}, a) : a, Ie = ({ type: a = "text", name: t, label: r, className: n, locale: s, placeholder: l, multiple: o, options: d, localizable: u, prefix: c }) => {
|
|
1574
|
-
const { errors: h } = ct(), p =
|
|
1575
|
-
return i("div", { className: x("w-full", { "flex items-center flex-row-reverse justify-end": a === "switch" }, n), children: [typeof r == "string" && i(ke, { htmlFor: t, className: "font-medium flex items-center justify-between", children: [i("span", { className: "flex items-center", children: [r, u && e(bi, { className: "w-4 h-4 ml-1 text-gray-500" })] }), s && u && i("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded", children: [vt.get(s), " (", s, ")"] })] }), e(
|
|
1576
|
-
},
|
|
1574
|
+
const { errors: h } = ct(), p = Mc(h, t);
|
|
1575
|
+
return i("div", { className: x("w-full", { "flex items-center flex-row-reverse justify-end": a === "switch" }, n), children: [typeof r == "string" && i(ke, { htmlFor: t, className: "font-medium flex items-center justify-between", children: [i("span", { className: "flex items-center", children: [r, u && e(bi, { className: "w-4 h-4 ml-1 text-gray-500" })] }), s && u && i("span", { className: "flex items-center text-xs text-gray-500 ml-1 bg-gray-100 px-1 py-0.5 rounded", children: [vt.get(s), " (", s, ")"] })] }), e(Bc, { type: a, name: t, placeholder: l, options: d, multiple: o, prefix: c }), (p == null ? void 0 : p.message) && e("p", { className: "mt-1 text-sm text-red-500", children: p.message })] });
|
|
1576
|
+
}, Pc = ({ form: a, config: t, columns: r = 2 }) => {
|
|
1577
1577
|
var u;
|
|
1578
|
-
const { errors: n } = ct(), s =
|
|
1578
|
+
const { errors: n } = ct(), s = Wn(n, t.name), { fields: l, append: o, remove: d } = Gt({ control: a.control, name: t.name });
|
|
1579
1579
|
return (u = t.fields) != null && u.length ? e(C, { children: i("div", { className: "w-full col-span-full", children: [t.label && e("h4", { className: "text-2xl flex items-center justify-between font-semibold", children: t.label }), t.description && e("p", { className: "text-sm text-gray-500", children: t.description }), l.map((c, h) => {
|
|
1580
1580
|
var p;
|
|
1581
1581
|
return i(C, { children: [e("div", { className: x("grid gap-5 w-full border-l-[8px] border-blue-500 pl-5 py-3 mt-6", { "grid-cols-1": r === 1, "grid-cols-2": r === 2, "grid-cols-3": r === 3, "grid-cols-4": r === 4 }), children: (p = t.fields) == null ? void 0 : p.map(({ name: g, label: b, type: f, colspan: w, localizable: y, multiple: k, options: v, placeholder: N, prefix: R }) => e(Ie, { name: `${t.name}[${h}].${g}`, label: b, type: f ?? "text", localizable: y, className: x({ "col-span-1": w === 1, "col-span-2": w === 2, "col-span-3": w === 3, "col-span-4": w === 4 }), placeholder: N, multiple: k, options: v, prefix: R }, t.name + g)) }, c.id), h < l.length - 1 && e(W, {})] });
|
|
1582
|
-
}), i("div", { className: "flex justify-end space-x-3", children: [i("button", { type: "button", className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", onClick: () => o({}), children: [e(
|
|
1583
|
-
},
|
|
1582
|
+
}), i("div", { className: "flex justify-end space-x-3", children: [i("button", { type: "button", className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", onClick: () => o({}), children: [e(Js, { className: "w-4 h-4 text-blue-500" }), "Add New"] }), l.length > 1 && i("button", { type: "button", className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", onClick: () => d(l.length - 1), children: [e(Os, { className: "w-4 h-4 text-red-500" }), "Remove"] })] }), (s == null ? void 0 : s.message) && e("p", { className: "mt-1 text-sm text-red-500", children: s.message })] }) }) : null;
|
|
1583
|
+
}, Qc = ({ config: a, columns: t = 2 }) => {
|
|
1584
1584
|
var s;
|
|
1585
|
-
const { errors: r } = ct(), n =
|
|
1585
|
+
const { errors: r } = ct(), n = Wn(r, a.name);
|
|
1586
1586
|
return (s = a.fields) != null && s.length ? i("div", { className: "w-full col-span-full", children: [a.label && e("h4", { className: "text-2xl font-semibold mb-2", children: a.label }), a.description && e("p", { className: "text-sm text-gray-500 mb-3", children: a.description }), e("div", { className: x("grid gap-5", { "grid-cols-1": t === 1, "grid-cols-2": t === 2, "grid-cols-3": t === 3, "grid-cols-4": t === 4 }), children: a.fields.map(({ name: l, label: o, type: d, colspan: u, localizable: c, multiple: h, options: p, placeholder: g, prefix: b }) => e(Ie, { name: `${a.name}.${l}`, label: o, type: d ?? "text", localizable: c, className: x({ "col-span-1": u === 1, "col-span-2": u === 2, "col-span-3": u === 3, "col-span-4": u === 4 }), placeholder: g, multiple: h, options: p, prefix: b }, `${a.name}.${l}`)) }), (n == null ? void 0 : n.message) && e("p", { className: "mt-1 text-sm text-red-500", children: n.message })] }) : null;
|
|
1587
1587
|
};
|
|
1588
|
-
function
|
|
1588
|
+
function Tc(a, t) {
|
|
1589
1589
|
const { asChild: r, children: n } = a;
|
|
1590
1590
|
if (!r) return typeof t == "function" ? t(n) : t;
|
|
1591
1591
|
const s = S.Children.only(n);
|
|
1592
1592
|
return S.cloneElement(s, { children: typeof t == "function" ? t(s.props.children) : t });
|
|
1593
1593
|
}
|
|
1594
|
-
const
|
|
1595
|
-
|
|
1596
|
-
const
|
|
1597
|
-
}, asChild: a, ...s, children:
|
|
1598
|
-
|
|
1594
|
+
const Dr = S.forwardRef(({ className: a, children: t, ...r }, n) => e(at.Root, { ref: n, ...r, asChild: !1, children: e(at.List, { className: x("flex items-center justify-start whitespace-nowrap border-b [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "border-gray-200 dark:border-gray-800", a), children: t }) }));
|
|
1595
|
+
Dr.displayName = "TabNavigation";
|
|
1596
|
+
const Fr = S.forwardRef(({ asChild: a, disabled: t, className: r, children: n, ...s }, l) => e(at.Item, { className: "flex", "aria-disabled": t, children: e(at.Link, { "aria-disabled": t, className: x("group relative flex shrink-0 select-none items-center justify-center", t ? "pointer-events-none" : ""), ref: l, onSelect: () => {
|
|
1597
|
+
}, asChild: a, ...s, children: Tc({ asChild: a, children: n }, (o) => e("span", { className: x("-mb-px flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-3 pb-2 text-sm font-medium transition-all", "text-gray-500 dark:text-gray-500", "group-hover:text-gray-700 dark:group-hover:text-gray-400", "group-hover:border-gray-300 dark:group-hover:border-gray-400", "group-data-active:border-blue-600 group-data-active:text-blue-600", "dark:group-data-active:border-blue-500 dark:group-data-active:text-blue-500", t ? "pointer-events-none text-gray-300 dark:text-gray-700" : "", ye, r), children: o })) }) }));
|
|
1598
|
+
Fr.displayName = "TabNavigationLink";
|
|
1599
1599
|
const ze = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText: l, columns: o = 2, onSubmit: d }) => {
|
|
1600
1600
|
const u = a.watch("translations"), { organization: c, defaultLocale: h, supportedLocales: p } = be(), [g, b] = F(), f = ce(() => r.some((y) => y.localizable), [r]);
|
|
1601
1601
|
ee(() => {
|
|
@@ -1603,15 +1603,15 @@ const ze = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText
|
|
|
1603
1603
|
}, [c.data, h, a, p, u]), ee(() => {
|
|
1604
1604
|
a.formState.errors.translations && b(h);
|
|
1605
1605
|
}, [h, a.formState.errors.translations]);
|
|
1606
|
-
const w = i("div", { className: X("grid gap-5 w-full", { "grid-cols-1": o === 1, "grid-cols-2": o === 2, "grid-cols-3": o === 3, "grid-cols-4": o === 4 }), children: [f && e("div", { className: "col-span-full", children: e(
|
|
1606
|
+
const w = i("div", { className: X("grid gap-5 w-full", { "grid-cols-1": o === 1, "grid-cols-2": o === 2, "grid-cols-3": o === 3, "grid-cols-4": o === 4 }), children: [f && e("div", { className: "col-span-full", children: e(Dr, { className: "col-span-full mb-3", children: p.map((y) => {
|
|
1607
1607
|
const k = y === h;
|
|
1608
|
-
return e(
|
|
1608
|
+
return e(Fr, { active: y === g, onClick: () => b(y), className: "cursor-pointer", children: i(C, { children: [vt.get(y), " ", k && "(Default)"] }) }, y);
|
|
1609
1609
|
}) }) }), r.map((y) => {
|
|
1610
1610
|
const { name: k, label: v, type: N, colspan: R, localizable: T, multiple: D, options: H, placeholder: le, prefix: B } = y, J = !T || !g ? k : `translations[${p == null ? void 0 : p.indexOf(g)}].${k}`;
|
|
1611
|
-
return N === "object" ? e(
|
|
1611
|
+
return N === "object" ? e(Qc, { config: y }, k) : N === "array" ? e(Pc, { form: a, config: y }, k) : e(Ie, { name: J, label: v, type: N ?? "text", localizable: T, className: X({ "col-span-1": R === 1, "col-span-2": R === 2, "col-span-3": R === 3, "col-span-4": R === 4 }), placeholder: le, multiple: D, options: H, locale: g, prefix: B }, J);
|
|
1612
1612
|
}), d && i("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6 col-span-full border-t pt-7", children: [s && e(z, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: s, children: l ?? "Cancel" }), e(z, { type: "submit", className: "w-full sm:w-fit", isLoading: n, loadingText: "Saving...", children: t ?? "Save Data" })] })] });
|
|
1613
1613
|
return d ? e(Ue, { ...a, children: e("form", { onSubmit: a.handleSubmit((y) => d(y)), children: w }) }) : e("div", { className: "w-full", children: w });
|
|
1614
|
-
},
|
|
1614
|
+
}, Jc = [{ name: "name", label: "Manufacturer Name", type: "text", placeholder: "Acme Inc.", colspan: 2 }, { name: "about", label: "About", type: "textarea", placeholder: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", colspan: 2, localizable: !0 }, { name: "logo", label: "Logo", type: "file" }], as = ({ initialData: a }) => {
|
|
1615
1615
|
const { client: t } = I(), r = _(), n = K(), s = U(), { defaultLocale: l, supportedLocales: o } = be(), d = me({ resolver: ue(a ? Io : So), defaultValues: a ? { defaultLocale: l, name: a.name, logo: a.logo, translations: a.translations } : { defaultLocale: l, translations: o.map((p) => ({ locale: p })) } }), u = L({ mutationFn: async (p) => {
|
|
1616
1616
|
var f;
|
|
1617
1617
|
const g = { name: p.name, defaultLocale: p.defaultLocale, translations: p.translations, logoId: (f = p.logo) == null ? void 0 : f.id }, { status: b } = await t.manufacturer.createManufacturer({ params: { organizationId: s }, body: g });
|
|
@@ -1623,47 +1623,47 @@ const ze = ({ form: a, okText: t, config: r, loading: n, onCancel: s, cancelText
|
|
|
1623
1623
|
} }), h = async () => {
|
|
1624
1624
|
O.success("Manufacturer saved successfully"), r.push(n.manufacturers(s)), await se.invalidateQueries({ queryKey: ["manufacturers"] });
|
|
1625
1625
|
};
|
|
1626
|
-
return e(ze, { form: d, config:
|
|
1626
|
+
return e(ze, { form: d, config: Jc, onSubmit: (p) => {
|
|
1627
1627
|
a ? c.mutate(p, { onSuccess: h }) : u.mutate(p, { onSuccess: h });
|
|
1628
1628
|
}, loading: u.isPending || c.isPending, cancelText: "Go back", okText: a ? "Update Manufacturer" : "Create Manufacturer" });
|
|
1629
1629
|
};
|
|
1630
|
-
function Jc() {
|
|
1631
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Manufacturer" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "manufacturer-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "manufacturer-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Manufacturer Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })] }), e("div", { className: "md:col-span-2", children: e(ts, {}) })] }) }) }) })] });
|
|
1632
|
-
}
|
|
1633
1630
|
function Oc() {
|
|
1631
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Manufacturer" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "manufacturer-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "manufacturer-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Manufacturer Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })] }), e("div", { className: "md:col-span-2", children: e(as, {}) })] }) }) }) })] });
|
|
1632
|
+
}
|
|
1633
|
+
function Lc() {
|
|
1634
1634
|
const a = U(), t = Qa(), { client: r } = I(), { isLoading: n, data: s } = Q({ queryKey: ["manufacturers", a, t], queryFn: async () => {
|
|
1635
1635
|
const { status: l, body: o } = await r.manufacturer.getManufacturer({ params: { id: t, organizationId: a } });
|
|
1636
1636
|
if (l !== 200) throw O.error("Failed to fetch manufacturer. Please refresh or try again later."), new Error("Failed to fetch manufacturer");
|
|
1637
1637
|
return o;
|
|
1638
1638
|
}, throwOnError: !0, placeholderData: he });
|
|
1639
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Manufacturer" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "manufacturer-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "manufacturer-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Manufacturer Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })] }), e("div", { className: "md:col-span-2", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(
|
|
1640
|
-
}
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1639
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Manufacturer" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "manufacturer-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "manufacturer-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Manufacturer Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the manufacturer." })] }), e("div", { className: "md:col-span-2", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(as, { initialData: s }) })] }) }) }) })] });
|
|
1640
|
+
}
|
|
1641
|
+
const jc = S.forwardRef(({ className: a, children: t, ...r }, n) => e("div", { ref: n, children: e("div", { className: X("w-full overflow-auto whitespace-nowrap", a), ...r, children: t }) }));
|
|
1642
|
+
jc.displayName = "TableRoot";
|
|
1643
|
+
const Rr = S.forwardRef(({ className: a, ...t }, r) => e("table", { ref: r, className: X("w-full caption-bottom border-b", "border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1644
|
+
Rr.displayName = "Table";
|
|
1645
|
+
const Br = S.forwardRef(({ className: a, ...t }, r) => e("thead", { ref: r, className: X(a), ...t }));
|
|
1646
|
+
Br.displayName = "TableHead";
|
|
1647
1647
|
const aa = S.forwardRef(({ className: a, ...t }, r) => e("th", { ref: r, className: X("border-b px-4 py-3.5 text-left text-sm font-semibold", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1648
1648
|
aa.displayName = "TableHeaderCell";
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1649
|
+
const Mr = S.forwardRef(({ className: a, ...t }, r) => e("tbody", { ref: r, className: X("divide-y", "divide-gray-200 dark:divide-gray-800", a), ...t }));
|
|
1650
|
+
Mr.displayName = "TableBody";
|
|
1651
1651
|
const ra = S.forwardRef(({ className: a, ...t }, r) => e("tr", { ref: r, className: X("[&_td:last-child]:pr-4 [&_th:last-child]:pr-4", "[&_td:first-child]:pl-4 [&_th:first-child]:pl-4", a), ...t }));
|
|
1652
1652
|
ra.displayName = "TableRow";
|
|
1653
1653
|
const Pe = S.forwardRef(({ className: a, ...t }, r) => e("td", { ref: r, className: X("p-4 text-sm", "text-gray-600 dark:text-gray-400", a), ...t }));
|
|
1654
1654
|
Pe.displayName = "TableCell";
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1659
|
-
const
|
|
1655
|
+
const Vc = S.forwardRef(({ className: a, ...t }, r) => e("tfoot", { ref: r, className: X("border-t text-left font-medium", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1656
|
+
Vc.displayName = "TableFoot";
|
|
1657
|
+
const Zc = S.forwardRef(({ className: a, ...t }, r) => e("caption", { ref: r, className: X("mt-3 px-3 text-center text-sm", "text-gray-500 dark:text-gray-500", a), ...t }));
|
|
1658
|
+
Zc.displayName = "TableCaption";
|
|
1659
|
+
const Hc = x("hidden h-6 select-none items-center justify-center rounded-md bg-gray-800 px-2 font-mono text-xs text-gray-400 ring-1 ring-inset ring-gray-700 transition sm:flex"), ts = ({ open: a = !1, onOpenChange: t, defaultOpen: r = !1, disableAutoFocus: n = !0, children: s }) => i(G.Root, { open: a, onOpenChange: t, defaultOpen: r, children: [e(G.Anchor, { className: x("fixed inset-x-0 bottom-8 mx-auto flex w-fit items-center") }), e(G.Portal, { children: e(G.Content, { side: "top", sideOffset: 0, onOpenAutoFocus: (l) => {
|
|
1660
1660
|
n && l.preventDefault();
|
|
1661
1661
|
}, className: x("z-50", "data-[state=closed]:animate-hide", "data-[side=top]:animate-slideUpAndFade"), children: s }) })] });
|
|
1662
|
-
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1662
|
+
ts.displayName = "CommandBar";
|
|
1663
|
+
const rs = A.forwardRef(({ className: a, ...t }, r) => e("div", { ref: r, className: x("px-3 py-2.5 text-sm tabular-nums text-gray-300", a), ...t }));
|
|
1664
|
+
rs.displayName = "CommandBar.Value";
|
|
1665
|
+
const is = A.forwardRef(({ className: a, ...t }, r) => e("div", { ref: r, className: x("relative flex items-center rounded-lg bg-gray-900 px-1 shadow-lg shadow-black/30 dark:ring-1 dark:ring-white/10", a), ...t }));
|
|
1666
|
+
is.displayName = "CommandBarBar";
|
|
1667
1667
|
const $a = A.forwardRef(({ className: a, ...t }, r) => e("div", { ref: r, className: x("h-4 w-px bg-gray-700", a), ...t }));
|
|
1668
1668
|
$a.displayName = "CommandBar.Seperator";
|
|
1669
1669
|
const Ga = A.forwardRef(({ className: a, type: t = "button", label: r, action: n, shortcut: s, disabled: l, ...o }, d) => (A.useEffect(() => {
|
|
@@ -1673,11 +1673,11 @@ const Ga = A.forwardRef(({ className: a, type: t = "button", label: r, action: n
|
|
|
1673
1673
|
return l || document.addEventListener("keydown", u), () => {
|
|
1674
1674
|
document.removeEventListener("keydown", u);
|
|
1675
1675
|
};
|
|
1676
|
-
}, [n, s, l]), e("span", { className: x("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: x("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", ye), ...o, children: [e("span", { children: r }), e("span", { className:
|
|
1676
|
+
}, [n, s, l]), e("span", { className: x("flex items-center gap-x-2 rounded-lg bg-gray-900 p-1 text-base font-medium text-gray-50 outline-hidden transition focus:z-10 sm:text-sm", "sm:last-of-type:-mr-1", a), children: i("button", { ref: d, type: t, onClick: n, disabled: l, className: x("flex items-center gap-x-2 rounded-md px-1 py-1 hover:bg-gray-800", "focus-visible:bg-gray-800 focus-visible:hover:bg-gray-800", "disabled:text-gray-500", ye), ...o, children: [e("span", { children: r }), e("span", { className: Hc, children: s.label ? s.label.toUpperCase() : s.shortcut.toUpperCase() })] }) })));
|
|
1677
1677
|
Ga.displayName = "CommandBar.Command";
|
|
1678
|
-
function
|
|
1678
|
+
function Uc({ table: a, rowSelection: t }) {
|
|
1679
1679
|
const r = Object.keys(t).length > 0;
|
|
1680
|
-
return e(
|
|
1680
|
+
return e(ts, { open: r, children: i(is, { children: [i(rs, { children: [Object.keys(t).length, " selected"] }), e($a, {}), e(Ga, { label: "Edit", action: () => {
|
|
1681
1681
|
console.log("Edit");
|
|
1682
1682
|
}, shortcut: { shortcut: "e" } }), e($a, {}), e(Ga, { label: "Delete", action: () => {
|
|
1683
1683
|
console.log("Delete");
|
|
@@ -1685,7 +1685,7 @@ function Hc({ table: a, rowSelection: t }) {
|
|
|
1685
1685
|
a.resetRowSelection();
|
|
1686
1686
|
}, shortcut: { shortcut: "Escape", label: "esc" } })] }) });
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function qc({ meta: a, table: t }) {
|
|
1689
1689
|
const r = fe(), n = _(), s = We(), l = Number((r == null ? void 0 : r.get("page")) || "1"), o = (g, b) => {
|
|
1690
1690
|
const f = new URLSearchParams(r == null ? void 0 : r.toString());
|
|
1691
1691
|
return f.set(g, b), f.toString();
|
|
@@ -1699,20 +1699,20 @@ function Uc({ meta: a, table: t }) {
|
|
|
1699
1699
|
function ba({ meta: a, columns: t, error: r, data: n, loading: s, className: l, refetch: o }) {
|
|
1700
1700
|
var g, b;
|
|
1701
1701
|
const d = U(), u = K(), [c, h] = A.useState({}), p = vl({ data: n, columns: t, state: { rowSelection: c }, enableRowSelection: !0, getFilteredRowModel: Cl(), onRowSelectionChange: h, getCoreRowModel: Al(), getSortedRowModel: Nl(), manualPagination: !0, meta: { ...a, organizationId: d, refetch: o, routes: u } });
|
|
1702
|
-
return e(C, { children: i("div", { className: x("space-y-6 relative", l), children: [i("div", { className: "relative overflow-hidden overflow-x-auto", children: [s && !n ? e("div", { className: "flex items-center justify-center h-48", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) }) : i(C, { children: [i(
|
|
1702
|
+
return e(C, { children: i("div", { className: x("space-y-6 relative", l), children: [i("div", { className: "relative overflow-hidden overflow-x-auto", children: [s && !n ? e("div", { className: "flex items-center justify-center h-48", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) }) : i(C, { children: [i(Rr, { children: [e(Br, { children: p.getHeaderGroups().map((f) => e(ra, { className: "border-y border-gray-200 dark:border-gray-800 back", children: f.headers.map((w) => {
|
|
1703
1703
|
var y;
|
|
1704
|
-
return e(aa, { className: x("whitespace-nowrap py-1 text-sm sm:text-xs", (y = w.column.columnDef.meta) == null ? void 0 : y.className), children:
|
|
1705
|
-
}) }, f.id)) }), i(
|
|
1704
|
+
return e(aa, { className: x("whitespace-nowrap py-1 text-sm sm:text-xs", (y = w.column.columnDef.meta) == null ? void 0 : y.className), children: Lr(w.column.columnDef.header, w.getContext()) }, w.id);
|
|
1705
|
+
}) }, f.id)) }), i(Mr, { children: [r && e(ra, { children: e(Pe, { colSpan: t.length, className: "h-24 text-center text-red-500", children: "An error occurred while fetching data. Please refresh the site and try again." }) }), ((g = p.getRowModel().rows) == null ? void 0 : g.length) > 0 && p.getRowModel().rows.map((f) => e(ra, { className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900", children: f.getVisibleCells().map((w, y) => {
|
|
1706
1706
|
var k;
|
|
1707
|
-
return i(Pe, { className: x(f.getIsSelected() ? "bg-gray-50 dark:bg-gray-900" : "", "relative whitespace-nowrap py-1 text-gray-600 first:w-10 dark:text-gray-400", (k = w.column.columnDef.meta) == null ? void 0 : k.className), children: [y === 0 && f.getIsSelected() && e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }),
|
|
1708
|
-
}) }, f.id)), ((b = p.getRowModel().rows) == null ? void 0 : b.length) === 0 && !s && e(ra, { children: e(Pe, { colSpan: t.length, className: "h-24 text-center", children: "No results." }) })] })] }), s && n && e("div", { className: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) })] }), e(
|
|
1707
|
+
return i(Pe, { className: x(f.getIsSelected() ? "bg-gray-50 dark:bg-gray-900" : "", "relative whitespace-nowrap py-1 text-gray-600 first:w-10 dark:text-gray-400", (k = w.column.columnDef.meta) == null ? void 0 : k.className), children: [y === 0 && f.getIsSelected() && e("div", { className: "absolute inset-y-0 left-0 w-0.5 bg-blue-600 dark:bg-blue-500" }), Lr(w.column.columnDef.cell, w.getContext())] }, w.id);
|
|
1708
|
+
}) }, f.id)), ((b = p.getRowModel().rows) == null ? void 0 : b.length) === 0 && !s && e(ra, { children: e(Pe, { colSpan: t.length, className: "h-24 text-center", children: "No results." }) })] })] }), s && n && e("div", { className: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-10 h-10" }), e("p", { className: "text-gray-500 text-xs mt-1", children: "Loading..." })] }) })] }), e(Uc, { table: p, rowSelection: c })] }), a && e(qc, { meta: a, table: p })] }) });
|
|
1709
1709
|
}
|
|
1710
|
-
const
|
|
1710
|
+
const Wc = Le({ base: ["relative block w-full appearance-none rounded-md border px-2.5 py-1.5 outline-hidden transition sm:text-sm", "border-transparent dark:border-gray-800", "text-gray-900 dark:text-gray-50", "placeholder-gray-400 dark:placeholder-gray-500", "bg-gray-100 dark:bg-gray-950", "disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400", "dark:disabled:border-gray-700 dark:disabled:bg-gray-800 dark:disabled:text-gray-500", fa, "[&::--webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"], variants: { hasError: { true: zt }, enableStepper: { true: "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" } } }), xa = A.forwardRef(({ className: a, inputClassName: t, hasError: r, enableStepper: n, type: s = "search", ...l }, o) => i("div", { className: x("relative w-full", a), children: [e("input", { ref: o, type: s, className: x(Wc({ hasError: r, enableStepper: n }), "pl-8", t), ...l }), e("div", { className: x("pointer-events-none absolute bottom-0 left-2 flex h-full items-center justify-center", "text-gray-400 dark:text-gray-600"), children: e(Xt, { className: "size-[1.125rem] shrink-0", "aria-hidden": "true" }) })] }));
|
|
1711
1711
|
xa.displayName = "Searchbar";
|
|
1712
|
-
const Oe = S.forwardRef(({ className: a, checked: t, ...r }, n) => e(
|
|
1712
|
+
const Oe = S.forwardRef(({ className: a, checked: t, ...r }, n) => e(jr.Root, { ref: n, ...r, checked: t, className: x("relative inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded shadow-xs outline-hidden ring-1 ring-inset transition duration-100 enabled:cursor-pointer", "text-white dark:text-gray-50", "bg-white dark:bg-gray-950", "ring-gray-300 dark:ring-gray-800", "data-disabled:bg-gray-100 data-disabled:text-gray-400 data-disabled:ring-gray-300", "dark:data-disabled:bg-gray-800 dark:data-disabled:text-gray-500 dark:data-disabled:ring-gray-700", "enabled:data-[state=checked]:bg-blue-600 enabled:data-[state=checked]:ring-0 enabled:data-[state=checked]:ring-transparent", "enabled:data-[state=indeterminate]:bg-blue-600 enabled:data-[state=indeterminate]:ring-0 enabled:data-[state=indeterminate]:ring-transparent", ye, a), children: e(jr.Indicator, { asChild: !0, className: "flex size-full items-center justify-center", children: t === "indeterminate" ? e("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e("line", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2", x1: "4", x2: "12", y1: "8", y2: "8" }) }) : e("svg", { "aria-hidden": "true", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.2 5.59998L6.79999 9.99998L4.79999 7.99998", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2" }) }) }) }));
|
|
1713
1713
|
Oe.displayName = "Checkbox";
|
|
1714
1714
|
function P({ column: a, title: t, className: r }) {
|
|
1715
|
-
return a.getCanSort() ? i("div", { onClick: a.getToggleSortingHandler(), className: x(a.columnDef.enableSorting === !0 ? "-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-gray-50 dark:hover:bg-gray-900" : ""), children: [e("span", { children: t }), a.getCanSort() ? i("div", { className: "-space-y-2", children: [e(Ji, { className: x("size-3.5 text-gray-900 dark:text-gray-50", a.getIsSorted() === "desc" ? "opacity-30" : ""), "aria-hidden": "true" }), e(
|
|
1715
|
+
return a.getCanSort() ? i("div", { onClick: a.getToggleSortingHandler(), className: x(a.columnDef.enableSorting === !0 ? "-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-gray-50 dark:hover:bg-gray-900" : ""), children: [e("span", { children: t }), a.getCanSort() ? i("div", { className: "-space-y-2", children: [e(Ji, { className: x("size-3.5 text-gray-900 dark:text-gray-50", a.getIsSorted() === "desc" ? "opacity-30" : ""), "aria-hidden": "true" }), e(er, { className: x("size-3.5 text-gray-900 dark:text-gray-50", a.getIsSorted() === "asc" ? "opacity-30" : ""), "aria-hidden": "true" })] }) : null] }) : e("div", { className: x(r), children: t });
|
|
1716
1716
|
}
|
|
1717
1717
|
const $e = oe.Root;
|
|
1718
1718
|
$e.displayName = "DropdownMenu";
|
|
@@ -1720,27 +1720,27 @@ const Ge = oe.Trigger;
|
|
|
1720
1720
|
Ge.displayName = "DropdownMenuTrigger";
|
|
1721
1721
|
const Ia = oe.Group;
|
|
1722
1722
|
Ia.displayName = "DropdownMenuGroup";
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1723
|
+
const ns = oe.Sub;
|
|
1724
|
+
ns.displayName = "DropdownMenuSubMenu";
|
|
1725
|
+
const ss = oe.RadioGroup;
|
|
1726
|
+
ss.displayName = "DropdownMenuRadioGroup";
|
|
1727
|
+
const ls = A.forwardRef(({ className: a, children: t, ...r }, n) => i(oe.SubTrigger, { ref: n, className: x("relative flex cursor-default select-none items-center rounded py-1.5 pl-2 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 data-[state=open]:bg-gray-100 dark:focus-visible:bg-gray-900 dark:data-[state=open]:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...r, children: [t, e(gt, { className: "ml-auto size-4 shrink-0 text-gray-500", "aria-hidden": "true" })] }));
|
|
1728
|
+
ls.displayName = "DropdownMenuSubMenuTrigger";
|
|
1729
|
+
const os = A.forwardRef(({ className: a, collisionPadding: t = 8, ...r }, n) => e(oe.Portal, { children: e(oe.SubContent, { ref: n, collisionPadding: t, className: x("relative z-50 overflow-hidden rounded-md border p-1 shadow-xl shadow-black/[2.5%]", "min-w-32", "max-h-[var(--radix-popper-available-height)]", "bg-white dark:bg-gray-950", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[side=bottom]:animate-slideDownAndFade data-[side=left]:animate-slideLeftAndFade data-[side=right]:animate-slideRightAndFade data-[side=top]:animate-slideUpAndFade", a), ...r }) }));
|
|
1730
|
+
os.displayName = "DropdownMenuSubMenuContent";
|
|
1731
1731
|
const Ke = A.forwardRef(({ className: a, sideOffset: t = 8, collisionPadding: r = 8, align: n = "center", loop: s = !0, ...l }, o) => e(oe.Portal, { children: e(oe.Content, { ref: o, className: x("relative z-50 overflow-hidden rounded-md border p-1 shadow-xl shadow-black/[2.5%]", "min-w-[calc(var(--radix-dropdown-menu-trigger-width))]", "max-h-[var(--radix-popper-available-height)]", "bg-white dark:bg-gray-950", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[side=bottom]:animate-slideDownAndFade data-[side=left]:animate-slideLeftAndFade data-[side=right]:animate-slideRightAndFade data-[side=top]:animate-slideUpAndFade", a), sideOffset: t, align: n, collisionPadding: r, loop: s, ...l }) }));
|
|
1732
1732
|
Ke.displayName = "DropdownMenuContent";
|
|
1733
1733
|
const Ae = A.forwardRef(({ className: a, shortcut: t, hint: r, children: n, ...s }, l) => i(oe.Item, { ref: l, className: x("group/DropdownMenuItem relative flex cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...s, children: [n, r && e("span", { className: x("ml-auto pl-2 text-sm text-gray-400 dark:text-gray-600"), children: r }), t && e("span", { className: x("ml-auto pl-2 text-sm text-gray-400 dark:text-gray-600"), children: t })] }));
|
|
1734
1734
|
Ae.displayName = "DropdownMenuItem";
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1737
|
-
const Ka = A.forwardRef(({ className: a, hint: t, shortcut: r, children: n, iconType: s = "radio", ...l }, o) => i(oe.RadioItem, { ref: o, className: x("group/DropdownMenuRadioItem relative flex cursor-pointer select-none items-center gap-x-2 rounded py-1.5 pl-8 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...l, children: [s === "radio" ? i("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: [e(
|
|
1735
|
+
const _c = A.forwardRef(({ className: a, hint: t, shortcut: r, children: n, checked: s, ...l }, o) => i(oe.CheckboxItem, { ref: o, className: x("relative flex cursor-pointer select-none items-center gap-x-2 rounded py-1.5 pl-8 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), checked: s, ...l, children: [e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: e(oe.ItemIndicator, { children: e(ft, { "aria-hidden": "true", className: "size-full shrink-0 text-gray-800 dark:text-gray-200" }) }) }), n, t && e("span", { className: x("ml-auto text-sm font-normal text-gray-400 dark:text-gray-600"), children: t }), r && e("span", { className: x("ml-auto text-sm font-normal tracking-widest text-gray-400 dark:border-gray-800 dark:text-gray-600"), children: r })] }));
|
|
1736
|
+
_c.displayName = "DropdownMenuCheckboxItem";
|
|
1737
|
+
const Ka = A.forwardRef(({ className: a, hint: t, shortcut: r, children: n, iconType: s = "radio", ...l }, o) => i(oe.RadioItem, { ref: o, className: x("group/DropdownMenuRadioItem relative flex cursor-pointer select-none items-center gap-x-2 rounded py-1.5 pl-8 pr-1 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...l, children: [s === "radio" ? i("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: [e(al, { "aria-hidden": "true", className: "size-full shrink-0 text-blue-500 group-data-[state=checked]/DropdownMenuRadioItem:flex group-data-[state=unchecked]/DropdownMenuRadioItem:hidden dark:text-blue-500" }), e(tl, { "aria-hidden": "true", className: "size-full shrink-0 text-gray-300 group-data-[state=unchecked]/DropdownMenuRadioItem:flex group-data-[state=checked]/DropdownMenuRadioItem:hidden dark:text-gray-700" })] }) : s === "check" ? e("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: e(ft, { "aria-hidden": "true", className: "size-full shrink-0 text-gray-800 group-data-[state=checked]/DropdownMenuRadioItem:flex group-data-[state=unchecked]/DropdownMenuRadioItem:hidden dark:text-gray-200" }) }) : null, n, t && e("span", { className: x("ml-auto text-sm font-normal text-gray-400 dark:text-gray-600"), children: t }), r && e("span", { className: x("ml-auto text-sm font-normal tracking-widest text-gray-400 dark:border-gray-800 dark:text-gray-600"), children: r })] }));
|
|
1738
1738
|
Ka.displayName = "DropdownMenuRadioItem";
|
|
1739
1739
|
const Tt = A.forwardRef(({ className: a, ...t }, r) => e(oe.Label, { ref: r, className: x("px-2 py-2 text-xs font-medium tracking-wide", "text-gray-500 dark:text-gray-500", a), ...t }));
|
|
1740
1740
|
Tt.displayName = "DropdownMenuLabel";
|
|
1741
|
-
const
|
|
1742
|
-
|
|
1743
|
-
const la = ua(),
|
|
1741
|
+
const $c = A.forwardRef(({ className: a, ...t }, r) => e(oe.Separator, { ref: r, className: x("-mx-1 my-1 h-px border-t border-gray-200 dark:border-gray-800", a), ...t }));
|
|
1742
|
+
$c.displayName = "DropdownMenuSeparator";
|
|
1743
|
+
const la = ua(), Gc = [la.display({ id: "select", header: ({ table: a }) => e(Oe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Oe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), la.accessor("id", { header: ({ column: a }) => e(P, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
1744
1744
|
var n, s, l;
|
|
1745
1745
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
1746
1746
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.manufacturerEdit(r, a.getValue("id"))) ?? `/admin/${r}/manufacturers/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
@@ -1754,18 +1754,18 @@ const la = ua(), $c = [la.display({ id: "select", header: ({ table: a }) => e(Oe
|
|
|
1754
1754
|
var n, s, l;
|
|
1755
1755
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
1756
1756
|
return i($e, { children: [e(Ge, { asChild: !0, children: e(z, { variant: "ghost", className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900", children: e(yt, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300", "aria-hidden": "true" }) }) }), i(Ke, { align: "end", className: "min-w-40", children: [e(Ae, { children: e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.manufacturerEdit(r, a.getValue("id"))) ?? `/admin/${r}/manufacturers/${a.getValue("id")}`, className: "block", children: "Edit" }) }), e(Ae, { className: "text-red-600 dark:text-red-500", children: "Delete" })] })] });
|
|
1757
|
-
} })],
|
|
1757
|
+
} })], Kc = () => {
|
|
1758
1758
|
const { client: a } = I(), t = K(), r = U(), n = fe(), [s, l] = F(""), [o] = qe(s, 300), d = Number((n == null ? void 0 : n.get("page")) || "1"), { isLoading: u, isRefetching: c, isError: h, data: p } = Q({ queryKey: ["manufacturers", r, d, o], queryFn: async () => {
|
|
1759
1759
|
const { body: g, status: b } = await a.manufacturer.getManufacturers({ params: { organizationId: r }, query: { page: d, limit: 10, search: o } });
|
|
1760
1760
|
if (b !== 200) throw new Error("Failed to fetch organizations");
|
|
1761
1761
|
return g;
|
|
1762
1762
|
}, placeholderData: he });
|
|
1763
|
-
return i(C, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(xa, { type: "search", placeholder: "Search by manufaturer...", value: s, onChange: (g) => l(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.manufacturerCreate(r), children: ["Create Manufacturer", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ba, { error: h, loading: u || c, meta: p != null && p.meta ? { ...p == null ? void 0 : p.meta, currentPage: d } : void 0, data: (p == null ? void 0 : p.list) || [], columns:
|
|
1763
|
+
return i(C, { children: [i("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: [e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(xa, { type: "search", placeholder: "Search by manufaturer...", value: s, onChange: (g) => l(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }), e("div", { className: "flex items-center gap-2", children: e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.manufacturerCreate(r), children: ["Create Manufacturer", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ba, { error: h, loading: u || c, meta: p != null && p.meta ? { ...p == null ? void 0 : p.meta, currentPage: d } : void 0, data: (p == null ? void 0 : p.list) || [], columns: Gc, className: "mt-8" })] });
|
|
1764
1764
|
};
|
|
1765
|
-
function
|
|
1766
|
-
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Manufacturers" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(
|
|
1765
|
+
function Yc() {
|
|
1766
|
+
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Manufacturers" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(Kc, {}) })] });
|
|
1767
1767
|
}
|
|
1768
|
-
const
|
|
1768
|
+
const Xc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
1769
1769
|
var p;
|
|
1770
1770
|
const { client: s } = I(), l = L({ mutationFn: async ({ operation: g }) => {
|
|
1771
1771
|
if ((await s.order.updateStatus({ params: { id: t, organizationId: a, operation: g } })).status !== 200) throw new Error("Failed to update order status");
|
|
@@ -1807,7 +1807,7 @@ const Yc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
|
1807
1807
|
l.mutate({ operation: "cancelled" });
|
|
1808
1808
|
}, c = l.isPending, h = (p = l.variables) == null ? void 0 : p.operation;
|
|
1809
1809
|
return i("div", { className: "flex items-center gap-2 min-w-28", children: [i("button", { onClick: u, disabled: c || r === "cancelled" || r === "completed", className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", "tremor-id": "tremor-raw", children: [c && h === "cancelled" ? "Loading..." : "Cancel", e(za, { className: "w-4 h-4 text-red-600 dark:text-red-500" })] }), r !== "completed" && r !== "cancelled" && i("button", { onClick: d, disabled: c, className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", "tremor-id": "tremor-raw", children: [c && h !== "cancelled" ? "Loading..." : o, e(ut, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" })] })] });
|
|
1810
|
-
},
|
|
1810
|
+
}, em = ({ open: a, onOpenChange: t, order: r }) => {
|
|
1811
1811
|
var l, o, d, u, c, h, p;
|
|
1812
1812
|
if (!r) return null;
|
|
1813
1813
|
const n = (g) => new Intl.NumberFormat("en-US", { style: "currency", currency: r.currency || "PLN" }).format(g), s = (g) => {
|
|
@@ -1828,18 +1828,18 @@ const Yc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
|
1828
1828
|
return "gray";
|
|
1829
1829
|
}
|
|
1830
1830
|
};
|
|
1831
|
-
return e(Rt, { open: a, onOpenChange: t, children: i(Bt, { className: "sm:max-w-3xl overflow-y-auto max-h-[85vh]", children: [i(Mt, { children: [i("div", { className: "flex justify-between items-center", children: [i(Pt, { children: ["Order Details #", r.referenceId] }), e(
|
|
1831
|
+
return e(Rt, { open: a, onOpenChange: t, children: i(Bt, { className: "sm:max-w-3xl overflow-y-auto max-h-[85vh]", children: [i(Mt, { children: [i("div", { className: "flex justify-between items-center", children: [i(Pt, { children: ["Order Details #", r.referenceId] }), e($n, { className: "rounded-full hover:bg-gray-200 p-1 dark:hover:bg-gray-800", children: e(za, { className: "h-5 w-5" }) })] }), e(Qt, { children: r.acceptedAt ? `Ordered on ${q(new Date(r.acceptedAt), "MMMM dd, yyyy")}` : "Order details" })] }), i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-4", children: [i("div", { className: "bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-800", children: [e("h3", { className: "font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Order Status" }), i("div", { className: "flex flex-col gap-3", children: [i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Status" }), e(Ca, { color: s(r.status || "pending"), variant: "neutral", children: r.status || "Pending" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Accepted At" }), e("span", { children: r.acceptedAt ? q(new Date(r.acceptedAt), "dd.MM.yyyy HH:mm") : "N/A" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Ready For Dispatch" }), e("span", { children: r.readyForDispatchAt ? q(new Date(r.readyForDispatchAt), "dd.MM.yyyy HH:mm") : "N/A" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Dispatched At" }), e("span", { children: r.dispatchedAt ? q(new Date(r.dispatchedAt), "dd.MM.yyyy HH:mm") : "N/A" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Completed At" }), e("span", { children: r.completedAt ? q(new Date(r.completedAt), "dd.MM.yyyy HH:mm") : "N/A" })] })] })] }), i("div", { className: "bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-800", children: [e("h3", { className: "font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Payment Information" }), i("div", { className: "flex flex-col gap-3", children: [i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Method" }), e("span", { className: "font-medium", children: ((l = r.payment) == null ? void 0 : l.method) || "N/A" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Provider" }), e("span", { children: ((o = r.payment) == null ? void 0 : o.provider) || "N/A" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Status" }), e(Ca, { color: ((d = r.payment) == null ? void 0 : d.status) === "succeeded" ? "green" : "yellow", variant: "neutral", children: ((u = r.payment) == null ? void 0 : u.status) || "Pending" })] }), i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Total Amount" }), e("span", { className: "font-bold", children: n(Number((c = r.payment) == null ? void 0 : c.total) || 0) })] })] })] }), i("div", { className: "bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-800", children: [e("h3", { className: "font-medium text-gray-900 dark:text-gray-100 mb-3", children: r.fulfilmentMethod === "pickup" ? "Pickup Details" : "Shipping Address" }), r.shippingAddress ? i("div", { className: "flex flex-col gap-1", children: [i("p", { className: "font-medium", children: [r.shippingAddress.firstname, " ", r.shippingAddress.lastname] }), i("p", { children: [r.shippingAddress.addressLineOne, r.shippingAddress.doorNumber ? `, ${r.shippingAddress.doorNumber}` : ""] }), i("p", { children: [r.shippingAddress.zipCode, ", ", r.shippingAddress.city] }), e("p", { children: r.shippingAddress.country }), r.shippingAddress.phone && i("p", { className: "mt-2", children: ["Phone: ", r.shippingAddress.phone] })] }) : e("p", { className: "text-gray-500", children: "No address information available" })] }), i("div", { className: "bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-800", children: [e("h3", { className: "font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Fulfilment Details" }), i("div", { className: "flex flex-col gap-3", children: [i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Fulfilment Method" }), e(Ca, { color: "blue", variant: "neutral", children: r.fulfilmentMethod || "N/A" })] }), r.fulfilmentMethod === "delivery" && i("div", { className: "flex justify-between items-center", children: [e("span", { className: "text-gray-600 dark:text-gray-400", children: "Shipping Method" }), e("span", { children: ((h = r.shippingMethod) == null ? void 0 : h.title) || "Standard Shipping" })] })] })] })] }), i("div", { className: "mt-6 bg-gray-50 dark:bg-gray-900 rounded-lg p-4 border border-gray-200 dark:border-gray-800", children: [e("h3", { className: "font-medium text-gray-900 dark:text-gray-100 mb-3", children: "Order Items" }), e("div", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: r.items.map((g, b) => {
|
|
1832
1832
|
const f = g.translations.find((w) => w.locale === "en") || g.translations[0];
|
|
1833
1833
|
return i("div", { className: "py-3 flex justify-between items-center", children: [i("div", { className: "flex items-center gap-4", children: [g.image && e("div", { className: "h-16 w-16 rounded overflow-hidden shrink-0", children: e("img", { src: g.image.url, alt: (f == null ? void 0 : f.title) || "Product", className: "h-full w-full object-cover" }) }), i("div", { children: [e("h4", { className: "font-medium", children: (f == null ? void 0 : f.title) || "Product" }), (f == null ? void 0 : f.subtitle) && e("p", { className: "text-sm text-gray-500", children: f.subtitle }), i("p", { className: "text-sm mt-1", children: [n(g.unitPrice), " × ", g.quantity] })] })] }), e("div", { className: "font-medium", children: n(g.totalPrice) })] }, b);
|
|
1834
1834
|
}) }), e("div", { className: "mt-4 pt-4 border-t border-gray-200 dark:border-gray-800", children: i("div", { className: "flex justify-between items-center", children: [e("span", { className: "font-medium", children: "Total" }), e("span", { className: "font-bold text-lg", children: n(Number((p = r.payment) == null ? void 0 : p.total) || 0) })] }) })] })] }) });
|
|
1835
|
-
},
|
|
1835
|
+
}, am = ({ order: a }) => {
|
|
1836
1836
|
const [t, r] = F(!1);
|
|
1837
|
-
return i(C, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(
|
|
1838
|
-
},
|
|
1837
|
+
return i(C, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(em, { open: t, onOpenChange: r, order: a })] });
|
|
1838
|
+
}, tm = ({ order: a, table: t }) => {
|
|
1839
1839
|
const r = t.options.meta, n = (r == null ? void 0 : r.organizationId) || "", s = typeof (r == null ? void 0 : r.refetch) == "function" ? r.refetch : () => {
|
|
1840
1840
|
};
|
|
1841
|
-
return e(
|
|
1842
|
-
}, je = ua(),
|
|
1841
|
+
return e(Xc, { organizationId: n, id: a.id, status: a.status, refetch: s });
|
|
1842
|
+
}, je = ua(), rm = [je.accessor("id", { header: ({ column: a }) => e(P, { column: a, title: "ID" }), meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a }) => e(am, { order: a.original }), enableSorting: !0, enableHiding: !1 }), je.accessor("referenceId", { header: ({ column: a }) => e(P, { column: a, title: "Reference ID" }), cell: ({ row: a }) => e("div", { className: "w-[100px]", children: a.getValue("referenceId") }), meta: { className: "text-left", displayName: "ID" }, enableSorting: !1, enableHiding: !1 }), je.display({ id: "customer", meta: { className: "text-left", displayName: "ID" }, header: ({ column: a }) => e(P, { column: a, title: "Customer" }), cell: ({ row: a }) => {
|
|
1843
1843
|
var n, s;
|
|
1844
1844
|
const t = ((n = a.original.shippingAddress) == null ? void 0 : n.firstname) || "", r = ((s = a.original.shippingAddress) == null ? void 0 : s.lastname) || "";
|
|
1845
1845
|
return e("div", { children: `${t} ${r}`.trim() || "N/A" });
|
|
@@ -1857,20 +1857,20 @@ const Yc = ({ organizationId: a, id: t, status: r, refetch: n }) => {
|
|
|
1857
1857
|
var l, o, d, u;
|
|
1858
1858
|
const t = ((l = a.original.shippingAddress) == null ? void 0 : l.addressLineOne) || "", r = ((o = a.original.shippingAddress) == null ? void 0 : o.city) || "", n = ((d = a.original.shippingAddress) == null ? void 0 : d.doorNumber) || "", s = ((u = a.original.shippingAddress) == null ? void 0 : u.zipCode) || "";
|
|
1859
1859
|
return i("div", { children: [i("div", { children: [t, " ", n ? ` / ${n}` : ""] }), i("div", { children: [s ? `${s}, ` : "", r] })] });
|
|
1860
|
-
} }), je.display({ id: "status", header: ({ column: a }) => e(P, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(
|
|
1860
|
+
} }), je.display({ id: "status", header: ({ column: a }) => e(P, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(tm, { order: a.original, table: t }) })], im = () => {
|
|
1861
1861
|
const { client: a } = I(), t = U(), r = fe(), [n, s] = F(""), [l] = qe(n, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: u, isError: c, data: h, refetch: p } = Q({ queryKey: ["orders", t, o, l], queryFn: async () => {
|
|
1862
1862
|
const { body: g, status: b } = await a.order.getOrders({ params: { organizationId: t }, query: { page: o, limit: 10, search: l } });
|
|
1863
1863
|
if (b !== 200) throw new Error("Failed to fetch orders");
|
|
1864
1864
|
return g;
|
|
1865
1865
|
}, placeholderData: he });
|
|
1866
|
-
return i(C, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(xa, { type: "search", placeholder: "Search by order reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ba, { error: c, loading: d || u, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns:
|
|
1866
|
+
return i(C, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(xa, { type: "search", placeholder: "Search by order reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ba, { error: c, loading: d || u, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns: rm, className: "mt-8", refetch: p })] });
|
|
1867
1867
|
};
|
|
1868
|
-
function
|
|
1869
|
-
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Orders List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(
|
|
1868
|
+
function nm() {
|
|
1869
|
+
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Orders List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(im, {}) })] });
|
|
1870
1870
|
}
|
|
1871
|
-
const
|
|
1871
|
+
const ds = ({ onClose: a, initialData: t }) => {
|
|
1872
1872
|
var c;
|
|
1873
|
-
const { client: r } = I(), n = me({ resolver: ue(t ?
|
|
1873
|
+
const { client: r } = I(), n = me({ resolver: ue(t ? dr : fn), defaultValues: { ...t } }), s = n.watch("address.placeId"), l = n.watch("address.addressLineOne");
|
|
1874
1874
|
ee(() => {
|
|
1875
1875
|
(async () => {
|
|
1876
1876
|
if (s) {
|
|
@@ -1894,10 +1894,10 @@ const cs = ({ onClose: a, initialData: t }) => {
|
|
|
1894
1894
|
} }), u = (h) => {
|
|
1895
1895
|
t ? d.mutate(h) : o.mutate(h);
|
|
1896
1896
|
};
|
|
1897
|
-
return e("div", { className: "mt-6", children: e(Ue, { ...n, children: i("form", { onSubmit: n.handleSubmit((h) => u(h)), className: "grid gap-5 grid-cols-4", children: [t && i("div", { className: "col-span-2", children: [e(ke, { htmlFor: "organization-id", className: "font-medium flex items-center justify-between", children: "Organization ID" }), e("div", { className: "relative mt-2", children: e(pe, { id: "organization-id", value: t.id, disabled: !0, readOnly: !0, className: "w-full", copyValue: t.id, copySuccessMessage: "Organization ID copied to clipboard.", copyErrorMessage: "Failed to copy organization ID. Please try again." }) })] }), e(Ie, { name: "name", label: "Organization Name", placeholder: "Acme Inc.", className: "col-span-2" }), e(Ie, { name: "email", type: "email", label: "Support Email", placeholder: "john.doe@example.com", className: "col-span-2" }), e(Ie, { name: "phone", type: "phone-number", label: "Phone Number", placeholder: "Enter phone number", className: "col-span-2" }), i("div", { className: "col-span-4 text-sm text-gray-500", children: [e(ke, { htmlFor: "address.addressLineOne", className: "font-medium flex items-center justify-between", children: "Street / Address Line 1" }), e(
|
|
1897
|
+
return e("div", { className: "mt-6", children: e(Ue, { ...n, children: i("form", { onSubmit: n.handleSubmit((h) => u(h)), className: "grid gap-5 grid-cols-4", children: [t && i("div", { className: "col-span-2", children: [e(ke, { htmlFor: "organization-id", className: "font-medium flex items-center justify-between", children: "Organization ID" }), e("div", { className: "relative mt-2", children: e(pe, { id: "organization-id", value: t.id, disabled: !0, readOnly: !0, className: "w-full", copyValue: t.id, copySuccessMessage: "Organization ID copied to clipboard.", copyErrorMessage: "Failed to copy organization ID. Please try again." }) })] }), e(Ie, { name: "name", label: "Organization Name", placeholder: "Acme Inc.", className: "col-span-2" }), e(Ie, { name: "email", type: "email", label: "Support Email", placeholder: "john.doe@example.com", className: "col-span-2" }), e(Ie, { name: "phone", type: "phone-number", label: "Phone Number", placeholder: "Enter phone number", className: "col-span-2" }), i("div", { className: "col-span-4 text-sm text-gray-500", children: [e(ke, { htmlFor: "address.addressLineOne", className: "font-medium flex items-center justify-between", children: "Street / Address Line 1" }), e(yr, { onChange: (h) => {
|
|
1898
1898
|
n.setValue("address.addressLineOne", h.addressLineOne, { shouldValidate: !0 }), n.setValue("address.placeId", h.placeId, { shouldValidate: !0 });
|
|
1899
1899
|
}, value: l ?? "" }), ((c = n.formState.errors.address) == null ? void 0 : c.addressLineOne) && e("p", { className: "mt-1 text-sm text-red-500", children: n.formState.errors.address.addressLineOne.message })] }), e(Ie, { name: "address.addressLineTwo", label: "Door / Address Line 2", placeholder: "Apt 123", className: "col-span-2" }), e(Ie, { name: "address.zipCode", label: "Postal Code", placeholder: "12345", className: "col-span-2" }), e(Ie, { name: "address.city", label: "City", placeholder: "New York", className: "col-span-2" }), e(Ie, { name: "address.country", label: "Country", placeholder: "United States", className: "col-span-2", type: "country" }), e(Ie, { name: "logoFile", label: "Logo", type: "file", className: "col-span-2" }), i("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-5 col-span-full border-t pt-7", children: [a && e(z, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: a, children: "Cancel" }), e(z, { type: "submit", className: "w-full sm:w-fit", isLoading: o.isPending || d.isPending, loadingText: "Saving...", children: t ? "Update Data" : "Create Organization" })] })] }) }) });
|
|
1900
|
-
},
|
|
1900
|
+
}, sm = ({ invitation: a }) => {
|
|
1901
1901
|
var n;
|
|
1902
1902
|
const { client: t } = I(), r = L({ mutationFn: async () => {
|
|
1903
1903
|
const { status: s } = await t.access.acceptInvitation({ params: { invitationId: a.id } });
|
|
@@ -1908,43 +1908,43 @@ const cs = ({ onClose: a, initialData: t }) => {
|
|
|
1908
1908
|
O.error((s == null ? void 0 : s.message) || "Failed to accept invitation");
|
|
1909
1909
|
} });
|
|
1910
1910
|
return i("div", { className: "relative flex items-center rounded-md border border-dashed border-emerald-300 bg-emerald-50/50 px-4 py-3 shadow-xs dark:border-emerald-700 dark:bg-emerald-950/20", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-emerald-500 dark:bg-emerald-500", "aria-hidden": "true" }), e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-emerald-500 text-white text-xl flex items-center justify-center", children: [a.organization.name.charAt(0).toUpperCase(), (n = a.organization.name.charAt(1)) == null ? void 0 : n.toUpperCase()] }) }), i("div", { className: "border-l border-emerald-200 dark:border-emerald-800 ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [i("p", { className: "flex items-center gap-2", children: [e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: a.organization.name }), e("span", { className: "inline-flex items-center rounded-md bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-900 dark:text-emerald-300", children: "Invited" })] }), e("p", { className: "flex items-center gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: ["You have been invited as", " ", e("span", { className: "font-medium", children: a.role ?? "member" })] }) })] }), e("div", { children: e("button", { onClick: () => r.mutate(), disabled: r.isPending, className: "block rounded-full text-emerald-500 p-2 hover:bg-emerald-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-emerald-200 dark:border-emerald-700/60 hover:border-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none", children: e(pt, { className: "w-5 h-5" }) }) })] })] });
|
|
1911
|
-
},
|
|
1911
|
+
}, lm = () => {
|
|
1912
1912
|
const [a, t] = F(!1), r = K(), { client: n } = I(), { organizations: s } = be(), { data: l } = Q({ queryKey: ["user-invitations"], queryFn: async () => {
|
|
1913
1913
|
const { body: d, status: u } = await n.access.getUserInvitations();
|
|
1914
1914
|
return u !== 200 ? [] : d;
|
|
1915
1915
|
} }), o = () => t(!1);
|
|
1916
|
-
return i(C, { children: [i("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [i("div", { className: "flex justify-between items-center", children: [i("div", { children: [e("h1", { className: "text-2xl font-semibold text-gray-900 dark:text-gray-50", children: "Organizations" }), e("p", { className: "text-gray-500 sm:text-sm/6 dark:text-gray-500", children: "Select a organization to get started." })] }), e("div", { className: "w-min h-min", children: i(z, { onClick: () => t(!0), variant: "primary", children: [e(Te, { className: "w-4 h-4 mr-1" }), " Add New"] }) })] }), s.loading ? e("div", { className: "flex justify-center items-center h-32 mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [i("svg", { "aria-hidden": "true", className: "w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), e("p", { className: "text-gray-500 text-sm mt-2", children: "Loading organizations..." })] }) }) : i("div", { className: "grid grid-cols-1 gap-y-3 gap-x-4 animate-fade-in mt-5", children: [l == null ? void 0 : l.map((d) => e(
|
|
1916
|
+
return i(C, { children: [i("div", { className: "max-w-4xl mx-auto py-8 px-4", children: [i("div", { className: "flex justify-between items-center", children: [i("div", { children: [e("h1", { className: "text-2xl font-semibold text-gray-900 dark:text-gray-50", children: "Organizations" }), e("p", { className: "text-gray-500 sm:text-sm/6 dark:text-gray-500", children: "Select a organization to get started." })] }), e("div", { className: "w-min h-min", children: i(z, { onClick: () => t(!0), variant: "primary", children: [e(Te, { className: "w-4 h-4 mr-1" }), " Add New"] }) })] }), s.loading ? e("div", { className: "flex justify-center items-center h-32 mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [i("svg", { "aria-hidden": "true", className: "w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600", viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z", fill: "currentColor" }), e("path", { d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z", fill: "currentFill" })] }), e("p", { className: "text-gray-500 text-sm mt-2", children: "Loading organizations..." })] }) }) : i("div", { className: "grid grid-cols-1 gap-y-3 gap-x-4 animate-fade-in mt-5", children: [l == null ? void 0 : l.map((d) => e(sm, { invitation: d }, d.id)), s.data.map((d) => {
|
|
1917
1917
|
var u, c;
|
|
1918
|
-
return i("div", { className: "relative flex items-center rounded-md border border-gray-200 bg-white px-4 py-3 shadow-xs dark:border-gray-800 dark:bg-gray-900", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-blue-500 dark:bg-blue-500", "aria-hidden": "true" }), d.logoFile ? e(ve, { src: d.logoFile.url, alt: d.name, width: 100, height: 100, className: "rounded-lg ml-2 h-16 w-16 object-cover" }) : e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-blue-500 text-white text-xl flex items-center justify-center", children: [d.name.charAt(0).toUpperCase(), d.name.charAt(1).toUpperCase()] }) }), i("div", { className: "border-l ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [e("p", { className: "flex items-center justify-between gap-2", children: e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: d.name }) }), e("p", { className: "flex items-center justify-between gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: [(u = d.address) == null ? void 0 : u.addressLineOne, ",", " ", (c = d.address) == null ? void 0 : c.city] }) })] }), e("div", { children: e(E, { className: "block rounded-full text-blue-500 p-2 hover:bg-blue-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-gray-200 dark:border-gray-700/60 hover:border-blue-500", href: r.dashboard(d.id), children: e(
|
|
1919
|
-
})] })] }), i(Rt, { onOpenChange: o, open: a, children: [e(
|
|
1918
|
+
return i("div", { className: "relative flex items-center rounded-md border border-gray-200 bg-white px-4 py-3 shadow-xs dark:border-gray-800 dark:bg-gray-900", children: [e("span", { className: "absolute inset-x-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-md bg-blue-500 dark:bg-blue-500", "aria-hidden": "true" }), d.logoFile ? e(ve, { src: d.logoFile.url, alt: d.name, width: 100, height: 100, className: "rounded-lg ml-2 h-16 w-16 object-cover" }) : e("div", { className: "rounded-full ml-2", children: i("div", { className: "rounded-full h-14 w-14 bg-blue-500 text-white text-xl flex items-center justify-center", children: [d.name.charAt(0).toUpperCase(), d.name.charAt(1).toUpperCase()] }) }), i("div", { className: "border-l ml-6 pl-6 flex justify-between items-center w-full", children: [i("div", { children: [e("p", { className: "flex items-center justify-between gap-2", children: e("span", { className: "text-lg font-semibold text-gray-900 dark:text-gray-50", children: d.name }) }), e("p", { className: "flex items-center justify-between gap-2", children: i("span", { className: "text-sm text-gray-500 dark:text-gray-500", children: [(u = d.address) == null ? void 0 : u.addressLineOne, ",", " ", (c = d.address) == null ? void 0 : c.city] }) })] }), e("div", { children: e(E, { className: "block rounded-full text-blue-500 p-2 hover:bg-blue-500 hover:text-white hover:translate-y-[-2px] hover:shadow-lg transition mr-2 border border-gray-200 dark:border-gray-700/60 hover:border-blue-500", href: r.dashboard(d.id), children: e(Ls, { className: "w-5 h-5" }) }) })] })] }, d.id);
|
|
1919
|
+
})] })] }), i(Rt, { onOpenChange: o, open: a, children: [e(_n, { className: "w-full text-left" }), i(Bt, { className: "sm:max-w-xl", children: [i(Mt, { children: [e(Pt, { children: "Create a Organization" }), e(Qt, { className: "mt-1 text-sm leading-6", children: "Fill in the details below to create a new organization" })] }), e(ds, { onClose: o })] })] })] });
|
|
1920
1920
|
};
|
|
1921
|
-
function
|
|
1922
|
-
const { appearance: a } =
|
|
1923
|
-
return i("div", { className: "flex w-full min-h-screen", children: [t && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(ve, { src: t, alt: "Organization Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${t ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: e(
|
|
1921
|
+
function om() {
|
|
1922
|
+
const { appearance: a } = Gi(), t = a == null ? void 0 : a.organizationImage;
|
|
1923
|
+
return i("div", { className: "flex w-full min-h-screen", children: [t && e("div", { className: "hidden lg:block relative w-1/2 overflow-hidden", children: e(ve, { src: t, alt: "Organization Visual", width: 4e3, height: 2250, className: "w-full h-full object-cover min-h-screen" }) }), e("div", { className: `w-full ${t ? "lg:w-1/2" : ""} flex items-center justify-center p-8`, children: e("div", { className: "w-full max-w-md space-y-8", children: e(lm, {}) }) })] });
|
|
1924
1924
|
}
|
|
1925
1925
|
const st = ae.Root;
|
|
1926
1926
|
st.displayName = "Select";
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1927
|
+
const dm = ae.Group;
|
|
1928
|
+
dm.displayName = "SelectGroup";
|
|
1929
1929
|
const lt = ae.Value;
|
|
1930
1930
|
lt.displayName = "SelectValue";
|
|
1931
|
-
const
|
|
1931
|
+
const cm = [x("group/trigger flex w-full select-none items-center justify-between gap-2 truncate rounded-md border px-3 py-2 shadow-xs outline-hidden transition sm:text-sm", "border-gray-300 dark:border-gray-800", "text-gray-900 dark:text-gray-50", "data-placeholder:text-gray-500 dark:data-placeholder:text-gray-500", "bg-white dark:bg-gray-950", "hover:bg-gray-50 dark:hover:bg-gray-950/50", "data-disabled:bg-gray-100 data-disabled:text-gray-400", "dark:data-disabled:border-gray-700 dark:data-disabled:bg-gray-800 dark:data-disabled:text-gray-500", fa)], ot = S.forwardRef(({ className: a, hasError: t, children: r, ...n }, s) => i(ae.Trigger, { ref: s, className: x(cm, t ? zt : "", a), ...n, children: [e("span", { className: "truncate", children: r }), e(ae.Icon, { asChild: !0, children: e(er, { className: x("-mr-1 size-5 shrink-0", "text-gray-400 dark:text-gray-600", "group-data-disabled/trigger:text-gray-300 dark:group-data-disabled/trigger:text-gray-600") }) })] }));
|
|
1932
1932
|
ot.displayName = "SelectTrigger";
|
|
1933
|
-
const
|
|
1934
|
-
|
|
1935
|
-
const
|
|
1936
|
-
|
|
1937
|
-
const dt = S.forwardRef(({ className: a, position: t = "popper", children: r, sideOffset: n = 8, collisionPadding: s = 10, ...l }, o) => e(ae.Portal, { children: i(ae.Content, { ref: o, className: x("relative z-50 overflow-hidden rounded-md border shadow-xl shadow-black/[2.5%]", "min-w-[calc(var(--radix-select-trigger-width)-2px)] max-w-[95vw]", "max-h-(--radix-select-content-available-height)", "bg-white dark:bg-gray-950", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[side=bottom]:animate-slideDownAndFade data-[side=left]:animate-slideLeftAndFade data-[side=right]:animate-slideRightAndFade data-[side=top]:animate-slideUpAndFade", a), sideOffset: n, position: t, collisionPadding: s, ...l, children: [e(
|
|
1933
|
+
const cs = S.forwardRef(({ className: a, ...t }, r) => e(ae.ScrollUpButton, { ref: r, className: x("flex cursor-default items-center justify-center py-1", a), ...t, children: e(Ji, { className: "size-3 shrink-0", "aria-hidden": "true" }) }));
|
|
1934
|
+
cs.displayName = ae.ScrollUpButton.displayName;
|
|
1935
|
+
const ms = S.forwardRef(({ className: a, ...t }, r) => e(ae.ScrollDownButton, { ref: r, className: x("flex cursor-default items-center justify-center py-1", a), ...t, children: e(er, { className: "size-3 shrink-0", "aria-hidden": "true" }) }));
|
|
1936
|
+
ms.displayName = ae.ScrollDownButton.displayName;
|
|
1937
|
+
const dt = S.forwardRef(({ className: a, position: t = "popper", children: r, sideOffset: n = 8, collisionPadding: s = 10, ...l }, o) => e(ae.Portal, { children: i(ae.Content, { ref: o, className: x("relative z-50 overflow-hidden rounded-md border shadow-xl shadow-black/[2.5%]", "min-w-[calc(var(--radix-select-trigger-width)-2px)] max-w-[95vw]", "max-h-(--radix-select-content-available-height)", "bg-white dark:bg-gray-950", "text-gray-900 dark:text-gray-50", "border-gray-200 dark:border-gray-800", "will-change-[transform,opacity]", "data-[state=closed]:animate-hide", "data-[side=bottom]:animate-slideDownAndFade data-[side=left]:animate-slideLeftAndFade data-[side=right]:animate-slideRightAndFade data-[side=top]:animate-slideUpAndFade", a), sideOffset: n, position: t, collisionPadding: s, ...l, children: [e(cs, {}), e(ae.Viewport, { className: x("p-1", t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[calc(var(--radix-select-trigger-width))]"), children: r }), e(ms, {})] }) }));
|
|
1938
1938
|
dt.displayName = "SelectContent";
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1939
|
+
const mm = S.forwardRef(({ className: a, ...t }, r) => e(ae.Label, { ref: r, className: x("px-3 py-2 text-xs font-medium tracking-wide", "text-gray-500 dark:text-gray-500", a), ...t }));
|
|
1940
|
+
mm.displayName = "SelectGroupLabel";
|
|
1941
1941
|
const Qe = S.forwardRef(({ className: a, children: t, ...r }, n) => i(ae.Item, { ref: n, className: x("grid cursor-pointer grid-cols-[1fr_20px] gap-x-2 rounded px-3 py-2 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...r, children: [e(ae.ItemText, { className: "flex-1 truncate", children: t }), e(ae.ItemIndicator, { children: e(ft, { className: "size-5 shrink-0 text-gray-800 dark:text-gray-200", "aria-hidden": "true" }) })] }));
|
|
1942
1942
|
Qe.displayName = "SelectItem";
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1947
|
-
const Ye = ua(),
|
|
1943
|
+
const um = S.forwardRef(({ className: a, children: t, period: r, ...n }, s) => i(ae.Item, { ref: s, className: x("relative flex cursor-pointer items-center rounded py-2 pl-8 pr-3 outline-hidden transition-colors data-[state=checked]:font-semibold sm:text-sm", "text-gray-900 dark:text-gray-50", "data-disabled:pointer-events-none data-disabled:text-gray-400 data-disabled:hover:bg-none dark:data-disabled:text-gray-600", "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-900", "hover:bg-gray-100 dark:hover:bg-gray-900", a), ...n, children: [e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: e(ae.ItemIndicator, { children: e(ft, { className: "size-5 shrink-0 text-gray-800 dark:text-gray-200", "aria-hidden": "true" }) }) }), i("div", { className: "flex w-full items-center", children: [e("span", { className: "w-40 sm:w-32", children: e(ae.ItemText, { children: t }) }), e("span", { children: (r == null ? void 0 : r.from) && (r == null ? void 0 : r.to) && i("span", { className: "whitespace-nowrap font-normal text-gray-400", children: [q(r.from, "MMM d, yyyy"), " –", " ", q(r.to, "MMM d, yyyy")] }) })] })] }));
|
|
1944
|
+
um.displayName = "SelectItemPeriod";
|
|
1945
|
+
const pm = S.forwardRef(({ className: a, ...t }, r) => e(ae.Separator, { ref: r, className: x("-mx-1 my-1 h-px", "bg-gray-300 dark:bg-gray-700", a), ...t }));
|
|
1946
|
+
pm.displayName = "SelectSeparator";
|
|
1947
|
+
const Ye = ua(), hm = ({ row: a, table: t }) => {
|
|
1948
1948
|
var u, c;
|
|
1949
1949
|
const { client: r } = I(), n = a.getValue("publishedAt"), s = (u = t.options.meta) == null ? void 0 : u.organizationId, l = (c = t.options.meta) == null ? void 0 : c.refetch, o = L({ mutationFn: async () => {
|
|
1950
1950
|
if ((await r.productCategory.updateStatus({ params: { id: a.getValue("id"), organizationId: s, operation: n ? "unpublish" : "publish" } })).status !== 200) throw new Error("Failed to update product category status");
|
|
@@ -1953,7 +1953,7 @@ const Ye = ua(), pm = ({ row: a, table: t }) => {
|
|
|
1953
1953
|
o.mutate();
|
|
1954
1954
|
};
|
|
1955
1955
|
return o.isPending ? e("div", { className: "min-w-28", children: i("button", { className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", "tremor-id": "tremor-raw", disabled: !0, children: [e(de, { className: "w-4 h-4" }), " Saving..."] }) }) : e("div", { className: "min-w-28", children: i("button", { onClick: d, className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", "tremor-id": "tremor-raw", children: [n ? e(ut, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" }) : e(wi, { className: "w-4 h-4 text-red-600 dark:text-red-500" }), n ? "Published" : "Draft"] }) });
|
|
1956
|
-
},
|
|
1956
|
+
}, gm = ({ row: a, table: t }) => {
|
|
1957
1957
|
var d, u, c, h;
|
|
1958
1958
|
const { client: r } = I(), n = (d = t.options.meta) == null ? void 0 : d.organizationId, s = (u = t.options.meta) == null ? void 0 : u.refetch, l = L({ mutationFn: async () => {
|
|
1959
1959
|
if ((await r.productCategory.deleteProductCategory({ params: { id: a.getValue("id"), organizationId: n } })).status !== 204) throw new Error("Failed to delete product category");
|
|
@@ -1961,15 +1961,15 @@ const Ye = ua(), pm = ({ row: a, table: t }) => {
|
|
|
1961
1961
|
} }), o = () => {
|
|
1962
1962
|
window.confirm("Are you sure you want to delete this product category? This action cannot be undone.") && l.mutate();
|
|
1963
1963
|
};
|
|
1964
|
-
return i($e, { children: [e(Ge, { asChild: !0, children: e(z, { variant: "ghost", className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900", disabled: l.isPending, children: l.isPending ? e(de, { className: "size-4 shrink-0" }) : e(yt, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300", "aria-hidden": "true" }) }) }), i(Ke, { align: "end", className: "min-w-40", children: [e(Ae, { children: i(E, { href: ((h = (c = t.options.meta) == null ? void 0 : c.routes) == null ? void 0 : h.productCategoryEdit(n, a.getValue("id"))) ?? `/admin/${n}/product-categories/${a.getValue("id")}`, className: "block flex items-center gap-2", children: [e(ki, { className: "w-4 h-4" }), "Edit"] }) }), e(Ae, { className: "text-red-600 dark:text-red-500 cursor-pointer", onClick: o, disabled: l.isPending, children: i("div", { className: "flex items-center gap-2", children: [l.isPending ? e(de, { className: "w-4 h-4" }) : e(
|
|
1965
|
-
},
|
|
1964
|
+
return i($e, { children: [e(Ge, { asChild: !0, children: e(z, { variant: "ghost", className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900", disabled: l.isPending, children: l.isPending ? e(de, { className: "size-4 shrink-0" }) : e(yt, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300", "aria-hidden": "true" }) }) }), i(Ke, { align: "end", className: "min-w-40", children: [e(Ae, { children: i(E, { href: ((h = (c = t.options.meta) == null ? void 0 : c.routes) == null ? void 0 : h.productCategoryEdit(n, a.getValue("id"))) ?? `/admin/${n}/product-categories/${a.getValue("id")}`, className: "block flex items-center gap-2", children: [e(ki, { className: "w-4 h-4" }), "Edit"] }) }), e(Ae, { className: "text-red-600 dark:text-red-500 cursor-pointer", onClick: o, disabled: l.isPending, children: i("div", { className: "flex items-center gap-2", children: [l.isPending ? e(de, { className: "w-4 h-4" }) : e(Yt, { className: "w-4 h-4" }), l.isPending ? "Deleting..." : "Delete"] }) })] })] });
|
|
1965
|
+
}, fm = [Ye.display({ id: "select", header: ({ table: a }) => e(Oe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Oe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), Ye.accessor("id", { header: ({ column: a }) => e(P, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
1966
1966
|
var n, s, l;
|
|
1967
1967
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
1968
1968
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.productCategoryEdit(r, a.getValue("id"))) ?? `/admin/${r}/product-categories/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
1969
|
-
} }), Ye.accessor("slug", { header: ({ column: a }) => e(P, { column: a, title: "Slug" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" } }), Ye.accessor("title", { header: ({ column: a }) => e(P, { column: a, title: "Title" }), enableSorting: !1, meta: { className: "text-left", displayName: "Name" } }), Ye.accessor("publishedAt", { header: ({ column: a }) => e(P, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Status" }, cell: ({ row: a, table: t }) => e(
|
|
1969
|
+
} }), Ye.accessor("slug", { header: ({ column: a }) => e(P, { column: a, title: "Slug" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" } }), Ye.accessor("title", { header: ({ column: a }) => e(P, { column: a, title: "Title" }), enableSorting: !1, meta: { className: "text-left", displayName: "Name" } }), Ye.accessor("publishedAt", { header: ({ column: a }) => e(P, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Status" }, cell: ({ row: a, table: t }) => e(hm, { row: a, table: t }) }), Ye.accessor("createdAt", { header: ({ column: a }) => e(P, { column: a, title: "Created At" }), enableSorting: !1, meta: { className: "text-left", displayName: "Created At" }, cell: ({ row: a }) => {
|
|
1970
1970
|
const t = a.getValue("createdAt");
|
|
1971
1971
|
return new Date(t).toLocaleDateString();
|
|
1972
|
-
} }), Ye.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(
|
|
1972
|
+
} }), Ye.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(gm, { row: a, table: t }) })], ym = () => {
|
|
1973
1973
|
const { client: a } = I(), t = K(), { defaultLocale: r } = be(), n = U(), s = We(), l = _(), o = fe(), [d, u] = F(""), [c, h] = F("all"), p = Number((o == null ? void 0 : o.get("page")) || "1"), [g] = qe(d, 300), b = c === "all" ? void 0 : c, f = (T, D) => {
|
|
1974
1974
|
const H = new URLSearchParams(o == null ? void 0 : o.toString());
|
|
1975
1975
|
return H.set(T, D), H.toString();
|
|
@@ -1984,12 +1984,12 @@ const Ye = ua(), pm = ({ row: a, table: t }) => {
|
|
|
1984
1984
|
u(T.target.value), w();
|
|
1985
1985
|
}, className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }), i(st, { value: c, onValueChange: (T) => {
|
|
1986
1986
|
h(T), w();
|
|
1987
|
-
}, children: [e(ot, { className: "w-full sm:w-[190px]", children: e(lt, { placeholder: "All statuses" }) }), i(dt, { children: [e(Qe, { value: "all", children: "All statuses" }), e(Qe, { value: "published", children: "Published" }), e(Qe, { value: "unpublished", children: "Unpublished" })] })] })] }), e("div", { className: "flex items-center gap-2", children: e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCategoryCreate(n), children: ["Create Product Category", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ba, { error: v, loading: y || k, meta: N == null ? void 0 : N.meta, data: (N == null ? void 0 : N.list) || [], columns:
|
|
1987
|
+
}, children: [e(ot, { className: "w-full sm:w-[190px]", children: e(lt, { placeholder: "All statuses" }) }), i(dt, { children: [e(Qe, { value: "all", children: "All statuses" }), e(Qe, { value: "published", children: "Published" }), e(Qe, { value: "unpublished", children: "Unpublished" })] })] })] }), e("div", { className: "flex items-center gap-2", children: e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCategoryCreate(n), children: ["Create Product Category", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ba, { error: v, loading: y || k, meta: N == null ? void 0 : N.meta, data: (N == null ? void 0 : N.list) || [], columns: fm, className: "mt-8", refetch: R })] });
|
|
1988
1988
|
};
|
|
1989
|
-
function
|
|
1990
|
-
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Product Categories" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(
|
|
1989
|
+
function bm() {
|
|
1990
|
+
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Product Categories" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(ym, {}) })] });
|
|
1991
1991
|
}
|
|
1992
|
-
const
|
|
1992
|
+
const xm = [{ name: "slug", label: "Slug", type: "text", placeholder: "electronics", colspan: 2 }, { name: "title", label: "Title", type: "text", placeholder: "Electronics", colspan: 2, localizable: !0 }, { name: "description", label: "Description", type: "textarea", placeholder: "All electronic devices and accessories.", colspan: 2, localizable: !0 }, { name: "image", label: "Image", type: "file" }], us = ({ initialData: a }) => {
|
|
1993
1993
|
const { client: t } = I(), r = _(), n = K(), s = U(), { defaultLocale: l, supportedLocales: o } = be(), d = me({ resolver: ue(a ? mo : co), defaultValues: a ? { defaultLocale: l, slug: a.slug, image: a.image, translations: a.translations } : { defaultLocale: l, translations: o.map((p) => ({ locale: p })) } }), u = L({ mutationFn: async (p) => {
|
|
1994
1994
|
var f;
|
|
1995
1995
|
const g = { slug: p.slug, defaultLocale: p.defaultLocale, translations: p.translations, imageId: (f = p.image) == null ? void 0 : f.id }, { status: b } = await t.productCategory.createProductCategory({ params: { organizationId: s }, body: g });
|
|
@@ -2001,22 +2001,22 @@ const bm = [{ name: "slug", label: "Slug", type: "text", placeholder: "electroni
|
|
|
2001
2001
|
} }), h = async () => {
|
|
2002
2002
|
O.success("Product category saved successfully"), r.push(n.productCategories(s)), await se.invalidateQueries({ queryKey: ["productCategories"] });
|
|
2003
2003
|
};
|
|
2004
|
-
return e(ze, { form: d, config:
|
|
2004
|
+
return e(ze, { form: d, config: xm, onSubmit: (p) => {
|
|
2005
2005
|
a ? c.mutate(p, { onSuccess: h }) : u.mutate(p, { onSuccess: h });
|
|
2006
2006
|
}, loading: u.isPending || c.isPending, cancelText: "Go back", okText: a ? "Update Product Category" : "Create Product Category" });
|
|
2007
2007
|
};
|
|
2008
|
-
function xm() {
|
|
2009
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Product Category" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "product-category-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-category-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Category Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })] }), e("div", { className: "md:col-span-2", children: e(ps, {}) })] }) }) }) })] });
|
|
2010
|
-
}
|
|
2011
2008
|
function wm() {
|
|
2009
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Product Category" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "product-category-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-category-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Category Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })] }), e("div", { className: "md:col-span-2", children: e(us, {}) })] }) }) }) })] });
|
|
2010
|
+
}
|
|
2011
|
+
function km() {
|
|
2012
2012
|
const a = U(), t = Qa(), { client: r } = I(), { isLoading: n, data: s } = Q({ queryKey: ["productCategories", a, t], queryFn: async () => {
|
|
2013
2013
|
const { status: l, body: o } = await r.productCategory.getProductCategory({ params: { id: t, organizationId: a } });
|
|
2014
2014
|
if (l !== 200) throw O.error("Failed to fetch product category. Please refresh or try again later."), new Error("Failed to fetch product category");
|
|
2015
2015
|
return o;
|
|
2016
2016
|
}, throwOnError: !0, placeholderData: he });
|
|
2017
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Product Category" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "product-category-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-category-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Category Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })] }), e("div", { className: "md:col-span-2", children: n || !s ? e("div", { className: "flex justify-center items-center h-[500px] mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(
|
|
2017
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Product Category" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "product-category-info", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-category-info", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Category Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about the product category." })] }), e("div", { className: "md:col-span-2", children: n || !s ? e("div", { className: "flex justify-center items-center h-[500px] mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(us, { initialData: s }) })] }) }) }) })] });
|
|
2018
2018
|
}
|
|
2019
|
-
const
|
|
2019
|
+
const vm = ({ form: a }) => {
|
|
2020
2020
|
const { client: t } = I(), r = U(), { data: n } = Q({ queryKey: ["product-categories", r], queryFn: async () => {
|
|
2021
2021
|
const l = await t.productCategory.getProductCategories({ params: { organizationId: r }, query: { limit: 100 } });
|
|
2022
2022
|
if (l.status !== 200) throw new Error("Failed to fetch product categories");
|
|
@@ -2027,7 +2027,7 @@ const km = ({ form: a }) => {
|
|
|
2027
2027
|
return l.body.list.map((o) => ({ label: o.name, value: o.id }));
|
|
2028
2028
|
}, throwOnError: !0 });
|
|
2029
2029
|
return e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Basic Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the basic information of your product, including the name, description, base price, and other essential details." })] }), e("div", { className: "md:col-span-2", children: e(ze, { form: a, config: [{ name: "title", label: "Title", type: "text", placeholder: "Enter product name", colspan: 2, localizable: !0 }, { name: "description", label: "Description", type: "textarea", placeholder: "Enter product description", colspan: 2, localizable: !0 }, { name: "slug", label: "Slug", type: "text", placeholder: "Enter a URL-friendly slug" }, { name: "sku", label: "SKU (Stock Keeping Unit)", type: "text", placeholder: "Enter SKU" }, { name: "categories", label: "Categories", type: "select", options: n || [], multiple: !0 }, { name: "manufacturerId", label: "Manufacturer", type: "select", options: s || [] }, { name: "images", label: "Images", type: "file", multiple: !0, colspan: 2 }] }) })] }) });
|
|
2030
|
-
},
|
|
2030
|
+
}, Nm = ({ form: a }) => {
|
|
2031
2031
|
const [t, r] = S.useState([]);
|
|
2032
2032
|
S.useEffect(() => {
|
|
2033
2033
|
const d = a.getValues("metadata") || {}, u = Object.entries(d);
|
|
@@ -2048,14 +2048,14 @@ const km = ({ form: a }) => {
|
|
|
2048
2048
|
const h = [...t];
|
|
2049
2049
|
h[d][u] = c, r(h), n(h);
|
|
2050
2050
|
};
|
|
2051
|
-
return e("section", { "aria-labelledby": "product-metadata", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-metadata", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Metadata" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Add custom key-value pairs to store additional information about your product. Keys must start with a letter and contain only letters, numbers, underscores, or dashes." })] }), e("div", { className: "md:col-span-2", children: i("div", { className: "space-y-4", children: [t.map((d, u) => i("div", { className: "flex gap-4 items-start", children: [i("div", { className: "flex-1", children: [e(ke, { htmlFor: `metadata-key-${u}`, className: "font-medium", children: "Key" }), e(pe, { id: `metadata-key-${u}`, type: "text", value: d.key, onChange: (c) => o(u, "key", c.target.value), placeholder: "e.g., color, size, weight", className: "mt-2" })] }), i("div", { className: "flex-1", children: [e(ke, { htmlFor: `metadata-value-${u}`, className: "font-medium", children: "Value" }), e(pe, { id: `metadata-value-${u}`, type: "text", value: d.value, onChange: (c) => o(u, "value", c.target.value), placeholder: "e.g., red, large, 2.5kg", className: "mt-2" })] }), e(z, { type: "button", variant: "destructive", className: "mt-8 min-w-[42px] h-[42px] p-0", onClick: () => l(u), children: e(
|
|
2052
|
-
},
|
|
2053
|
-
const { defaultLocale: s, supportedLocales: l } = be(), o = me({ resolver: ue(
|
|
2051
|
+
return e("section", { "aria-labelledby": "product-metadata", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-metadata", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Metadata" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Add custom key-value pairs to store additional information about your product. Keys must start with a letter and contain only letters, numbers, underscores, or dashes." })] }), e("div", { className: "md:col-span-2", children: i("div", { className: "space-y-4", children: [t.map((d, u) => i("div", { className: "flex gap-4 items-start", children: [i("div", { className: "flex-1", children: [e(ke, { htmlFor: `metadata-key-${u}`, className: "font-medium", children: "Key" }), e(pe, { id: `metadata-key-${u}`, type: "text", value: d.key, onChange: (c) => o(u, "key", c.target.value), placeholder: "e.g., color, size, weight", className: "mt-2" })] }), i("div", { className: "flex-1", children: [e(ke, { htmlFor: `metadata-value-${u}`, className: "font-medium", children: "Value" }), e(pe, { id: `metadata-value-${u}`, type: "text", value: d.value, onChange: (c) => o(u, "value", c.target.value), placeholder: "e.g., red, large, 2.5kg", className: "mt-2" })] }), e(z, { type: "button", variant: "destructive", className: "mt-8 min-w-[42px] h-[42px] p-0", onClick: () => l(u), children: e(js, { className: "w-4 h-4" }) })] }, d.id)), t.length === 0 && e("p", { className: "text-sm text-gray-500 italic", children: "No metadata added yet. Click the button below to add key-value pairs." }), i(z, { type: "button", variant: "secondary", onClick: s, className: "w-full shadow-none mt-2", children: [e(Te, { className: "w-4 h-4 mr-2" }), "Add Row"] })] }) })] }) });
|
|
2052
|
+
}, Am = ({ open: a, onClose: t, initialData: r, onSubmit: n }) => {
|
|
2053
|
+
const { defaultLocale: s, supportedLocales: l } = be(), o = me({ resolver: ue(ln), defaultValues: r ? { ...r, defaultLocale: s } : { defaultLocale: s, translations: l.map((p) => ({ locale: p, title: "" })), modifiers: [{ title: "", price: 0 }] } }), { fields: d, append: u, remove: c } = Gt({ control: o.control, name: "modifiers" }), h = (p) => {
|
|
2054
2054
|
n(p), t(), o.reset({ defaultLocale: s, translations: l.map((g) => ({ locale: g, title: "" })), modifiers: [{ title: "", price: 0 }] });
|
|
2055
2055
|
};
|
|
2056
2056
|
return e(Rt, { open: a, onOpenChange: t, children: i(Bt, { className: "max-w-[710px]", children: [i(Mt, { children: [e(Pt, { children: "New Modifier Group" }), e(Qt, { className: "text-sm mb-5", children: "Modifiers allow you to create different variants of the same product. Create or choose existing modifiers for your product." })] }), i(Ue, { ...o, children: [e(ze, { form: o, config: [{ name: "title", label: "Group Title", type: "text", placeholder: 'For example: "Spice Level" or "Select toppings".', colspan: 2, localizable: !0 }, { name: "selectMin", label: "Select Min", type: "number", placeholder: "Minimum selections", colspan: 1 }, { name: "selectMax", label: "Select Max", type: "number", placeholder: "Maximum selections", colspan: 1 }] }), e("h3", { className: "text-lg font-semibold mt-6", children: "Modifier Options" }), e("p", { className: "text-sm text-gray-500 mb-6 mt-1", children: "Add options to this modifier group. Modifier options are the different variants of the product. The price adds to the base price of the product. Leave the price as 0 if it's free." }), d.map((p, g) => i("div", { className: "mb-4 flex", children: [e(ze, { form: o, columns: 2, config: [{ name: `modifiers.${g}.title`, label: "Title", type: "text", placeholder: 'eg: "Mild" or "Pepperoni"', colspan: 1 }, { name: `modifiers.${g}.price`, label: "Price", type: "number", placeholder: "Price for this modifier", colspan: 1, prefix: "USD" }] }), d.length > 1 && e(z, { type: "button", variant: "destructive", className: "mt-auto ml-4 min-w-[42px] h-[42px] p-0! shadow-none!", onClick: () => c(g), children: e(mt, { className: "w-4 h-4" }) })] }, p.id)), e(z, { type: "button", variant: "secondary", className: "mb-4 mt-4 ml-auto w-full shadow-none", onClick: () => u({ title: "", price: 0 }), children: "Add Another Option" }), e(W, { className: "mt-8 mb-6" }), i("div", { className: "flex justify-end space-x-3 mt-6 col-span-full", children: [e(z, { type: "button", className: "w-full sm:w-fit", variant: "secondary", onClick: t, children: "Cancel" }), e(z, { type: "button", className: "w-full sm:w-fit", onClick: o.handleSubmit(h), children: r ? "Save Modifier Group" : "Create Modifier Group" })] })] })] }) });
|
|
2057
|
-
},
|
|
2058
|
-
const { control: t } = a, { defaultLocale: r } = be(), { fields: n, append: s, remove: l, update: o } =
|
|
2057
|
+
}, Cm = ({ form: a }) => {
|
|
2058
|
+
const { control: t } = a, { defaultLocale: r } = be(), { fields: n, append: s, remove: l, update: o } = Gt({ control: t, name: "modifierGroups" }), [d, u] = F(!1), [c, h] = F(null), p = (y) => ({ ...y, defaultLocale: y.defaultLocale ?? r, modifiers: y.modifiers ?? [] }), g = (y) => {
|
|
2059
2059
|
y.preventDefault(), h(null), u(!0);
|
|
2060
2060
|
}, b = (y) => {
|
|
2061
2061
|
h(y), u(!0);
|
|
@@ -2068,16 +2068,16 @@ const km = ({ form: a }) => {
|
|
|
2068
2068
|
}, w = () => {
|
|
2069
2069
|
s({ defaultLocale: r, selectMin: 1, selectMax: 1, modifiers: [{ title: "Łagodny (Mild)", sku: "null", price: 0 }, { title: "Średni (Medium)", sku: "null", price: 0 }, { title: "Ostry (Spicy)", sku: "null", price: 0 }], translations: [{ locale: "en", title: "Spice Level" }, { locale: "pl", title: "Ostrość" }] });
|
|
2070
2070
|
};
|
|
2071
|
-
return i("section", { "aria-labelledby": "product-modifiers", className: "min-h-[200px]", children: [i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-modifiers", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Modifiers (Optional)" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Modifiers allow you to create different variants of the same product. Create or choose existing modifiers for your product." })] }), e("div", { className: "md:col-span-2", children: n.length === 0 ? i("div", { className: "text-center flex-col justify-center items-center", children: [e("h3", { className: "text-lg font-semibold", children: "No Modifier Groups" }), e("p", { className: "text-gray-500 max-w-[500px] mx-auto mt-1", children: "If your product has different options or variants, you can add modifier groups to manage them." }), i("div", { className: "flex space-x-3 mx-auto w-min mt-6", children: [i(z, { type: "button", variant: "secondary", className: "shadow-none", onClick: w, children: [e(
|
|
2071
|
+
return i("section", { "aria-labelledby": "product-modifiers", className: "min-h-[200px]", children: [i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-modifiers", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Product Modifiers (Optional)" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Modifiers allow you to create different variants of the same product. Create or choose existing modifiers for your product." })] }), e("div", { className: "md:col-span-2", children: n.length === 0 ? i("div", { className: "text-center flex-col justify-center items-center", children: [e("h3", { className: "text-lg font-semibold", children: "No Modifier Groups" }), e("p", { className: "text-gray-500 max-w-[500px] mx-auto mt-1", children: "If your product has different options or variants, you can add modifier groups to manage them." }), i("div", { className: "flex space-x-3 mx-auto w-min mt-6", children: [i(z, { type: "button", variant: "secondary", className: "shadow-none", onClick: w, children: [e(Pr, { className: "w-4 h-4 mr-2" }), " Add From Template"] }), i(z, { type: "button", variant: "secondary", className: "shadow-none", onClick: g, children: [e(Te, { className: "w-4 h-4 mr-2" }), " Create Modifier Group"] })] })] }) : i("div", { className: "space-y-10", children: [i("div", { className: "flex justify-end space-x-3", children: [i(z, { type: "button", variant: "secondary", className: "shadow-none", onClick: w, children: [e(Pr, { className: "w-4 h-4 mr-2" }), " Add From Template"] }), i(z, { type: "button", variant: "secondary", className: "shadow-none", onClick: g, children: [e(Te, { className: "w-4 h-4 mr-2" }), " Create Modifier Group"] })] }), e("div", { className: "space-y-4", children: n.map((y, k) => {
|
|
2072
2072
|
var v;
|
|
2073
2073
|
return i("div", { className: "p-4 border rounded-md", children: [i("div", { className: "flex justify-between items-center", children: [e("h3", { className: "text-lg font-semibold", children: y.translations[0].title || "Unnamed Group" }), i("div", { children: [e("button", { type: "button", onClick: () => b(k), className: "text-blue-500 font-medium hover:underline text-sm mr-4", children: "Edit" }), e("button", { type: "button", onClick: () => l(k), className: "text-red-500 font-medium hover:underline text-sm p-0!", children: "Remove" })] })] }), i("p", { className: "text-sm text-gray-500 mt-3", children: ["Min: ", y.selectMin, " | Max: ", y.selectMax] }), i("p", { className: "text-sm text-gray-500 mt-1", children: ["Available Options:", " ", (v = y.modifiers) == null ? void 0 : v.map((N) => N == null ? void 0 : N.title).join(",")] })] }, y.id);
|
|
2074
|
-
}) })] }) })] }), e(
|
|
2074
|
+
}) })] }) })] }), e(Am, { open: d, initialData: c === null ? null : n[c], onSubmit: f, onClose: () => {
|
|
2075
2075
|
u(!1), h(null);
|
|
2076
2076
|
} }, c)] });
|
|
2077
|
-
},
|
|
2077
|
+
}, Sm = ({ form: a, loading: t }) => {
|
|
2078
2078
|
const { defaultCurrency: r } = be();
|
|
2079
2079
|
return e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Pricing" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the pricing details of your product, including the base price and discounted price." })] }), e("div", { className: "md:col-span-2", children: e(ze, { form: a, config: [{ name: "basePrice", label: "Base Price", type: "number", placeholder: "Enter base price", prefix: r }, { name: "discountedBasePrice", label: "Discounted Price", type: "number", placeholder: "Enter discounted price", prefix: r }], loading: t }) })] }) });
|
|
2080
|
-
},
|
|
2080
|
+
}, ps = ({ initialData: a }) => {
|
|
2081
2081
|
var f, w;
|
|
2082
2082
|
const { client: t } = I(), r = _(), n = K(), s = U(), { defaultCurrency: l, defaultLocale: o, supportedLocales: d } = be(), u = a == null ? void 0 : a.id, c = me({ resolver: ue(a ? go : ho), defaultValues: a ? { ...a, defaultLocale: o, categories: (f = a.categories) == null ? void 0 : f.map((y) => y.id), translations: a.translations, images: a.images, metadata: a.metadata, modifierGroups: (w = a.modifierGroups) == null ? void 0 : w.map((y) => ({ ...y, defaultLocale: o, translations: y.translations, modifiers: y.modifiers })) } : { defaultLocale: o, translations: d.map((y) => ({ locale: y })), currency: l } }), h = L({ mutationFn: async (y) => {
|
|
2083
2083
|
const { status: k } = await t.product.createProduct({ params: { organizationId: s }, body: y });
|
|
@@ -2090,20 +2090,20 @@ const km = ({ form: a }) => {
|
|
|
2090
2090
|
}, b = (y) => {
|
|
2091
2091
|
a ? p.mutate(y, { onSuccess: g }) : h.mutate(y, { onSuccess: g });
|
|
2092
2092
|
};
|
|
2093
|
-
return e(Ue, { ...c, children: i("form", { onSubmit: c.handleSubmit((y) => b(y)), className: "space-y-14", children: [e(
|
|
2093
|
+
return e(Ue, { ...c, children: i("form", { onSubmit: c.handleSubmit((y) => b(y)), className: "space-y-14", children: [e(vm, { form: c }), e(W, {}), e(Sm, { form: c }), e(W, {}), e(Cm, { form: c }), e(W, {}), e(Nm, { form: c }), e(W, {}), i("div", { className: "flex justify-end space-x-3", children: [i(z, { type: "button", variant: "secondary", onClick: () => r.push(n.products(s)), children: [e(Da, { className: "w-4 h-4 mr-2" }), " Cancel"] }), i(z, { type: "submit", isLoading: h.isPending || p.isPending, loadingText: "Saving...", children: [e(pt, { className: "w-4 h-4 mr-2" }), " ", a ? "Save Product" : "Create Product"] })] })] }) });
|
|
2094
2094
|
};
|
|
2095
|
-
function Sm() {
|
|
2096
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Product" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(hs, {}) }) })] });
|
|
2097
|
-
}
|
|
2098
2095
|
function Im() {
|
|
2096
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Product" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(ps, {}) }) })] });
|
|
2097
|
+
}
|
|
2098
|
+
function Em() {
|
|
2099
2099
|
const a = U(), t = Qa(), { client: r } = I(), { data: n, isLoading: s } = Q({ queryKey: ["product", a, t], queryFn: async () => {
|
|
2100
2100
|
const { status: l, body: o } = await r.product.getProduct({ params: { organizationId: a, id: t } });
|
|
2101
2101
|
if (l !== 200) throw O.error("Failed to load product"), new Error("Failed to fetch product");
|
|
2102
2102
|
return o;
|
|
2103
2103
|
} });
|
|
2104
|
-
return i("div", { className: "space-y-6", children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Edit Product" }), e(W, {}), s ? e("div", { className: "flex justify-center py-8", children: e(de, { className: "w-8 h-8" }) }) : e("div", { className: "pt-6", children: e(
|
|
2104
|
+
return i("div", { className: "space-y-6", children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Edit Product" }), e(W, {}), s ? e("div", { className: "flex justify-center py-8", children: e(de, { className: "w-8 h-8" }) }) : e("div", { className: "pt-6", children: e(ps, { initialData: n }) })] });
|
|
2105
2105
|
}
|
|
2106
|
-
const Be = ua(),
|
|
2106
|
+
const Be = ua(), zm = ({ row: a, table: t }) => {
|
|
2107
2107
|
var u;
|
|
2108
2108
|
const { client: r } = I(), n = a.getValue("publishedAt"), s = (u = t.options.meta) == null ? void 0 : u.organizationId, l = t.options.meta.refetch, o = L({ mutationFn: async () => {
|
|
2109
2109
|
if ((await r.product.updateStatus({ params: { id: a.getValue("id"), organizationId: s, operation: n ? "unpublish" : "publish" } })).status !== 200) throw new Error("Failed to update product status");
|
|
@@ -2112,7 +2112,7 @@ const Be = ua(), Em = ({ row: a, table: t }) => {
|
|
|
2112
2112
|
o.mutate();
|
|
2113
2113
|
};
|
|
2114
2114
|
return o.isPending ? e("div", { className: "min-w-28", children: i("button", { className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", "tremor-id": "tremor-raw", disabled: !0, children: [e(de, { className: "w-4 h-4" }), " Saving..."] }) }) : e("div", { className: "min-w-28", children: i("button", { onClick: d, className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", "tremor-id": "tremor-raw", children: [n ? e(ut, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" }) : e(wi, { className: "w-4 h-4 text-red-600 dark:text-red-500" }), n ? "Published" : "Draft"] }) });
|
|
2115
|
-
},
|
|
2115
|
+
}, Dm = ({ row: a, table: t }) => {
|
|
2116
2116
|
var d, u, c;
|
|
2117
2117
|
const { client: r } = I(), n = (d = t.options.meta) == null ? void 0 : d.organizationId, s = t.options.meta.refetch, l = L({ mutationFn: async () => {
|
|
2118
2118
|
if ((await r.product.deleteProduct({ params: { id: a.getValue("id"), organizationId: n } })).status !== 204) throw new Error("Failed to delete product");
|
|
@@ -2120,18 +2120,18 @@ const Be = ua(), Em = ({ row: a, table: t }) => {
|
|
|
2120
2120
|
} }), o = () => {
|
|
2121
2121
|
window.confirm("Are you sure you want to delete this product? This action cannot be undone.") && l.mutate();
|
|
2122
2122
|
};
|
|
2123
|
-
return i($e, { children: [e(Ge, { asChild: !0, children: e(z, { variant: "ghost", className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900", disabled: l.isPending, children: l.isPending ? e(de, { className: "size-4 shrink-0" }) : e(yt, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300", "aria-hidden": "true" }) }) }), i(Ke, { align: "end", className: "min-w-40", children: [e(Ae, { children: i(E, { href: ((c = (u = t.options.meta) == null ? void 0 : u.routes) == null ? void 0 : c.productEdit(n, a.getValue("id"))) ?? `/admin/${n}/products/${a.getValue("id")}`, className: "block flex items-center gap-2", children: [e(ki, { className: "w-4 h-4" }), "Edit"] }) }), e(Ae, { className: "text-red-600 dark:text-red-500 cursor-pointer", onClick: o, disabled: l.isPending, children: i("div", { className: "flex items-center gap-2", children: [l.isPending ? e(de, { className: "w-4 h-4" }) : e(
|
|
2124
|
-
},
|
|
2123
|
+
return i($e, { children: [e(Ge, { asChild: !0, children: e(z, { variant: "ghost", className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900", disabled: l.isPending, children: l.isPending ? e(de, { className: "size-4 shrink-0" }) : e(yt, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300", "aria-hidden": "true" }) }) }), i(Ke, { align: "end", className: "min-w-40", children: [e(Ae, { children: i(E, { href: ((c = (u = t.options.meta) == null ? void 0 : u.routes) == null ? void 0 : c.productEdit(n, a.getValue("id"))) ?? `/admin/${n}/products/${a.getValue("id")}`, className: "block flex items-center gap-2", children: [e(ki, { className: "w-4 h-4" }), "Edit"] }) }), e(Ae, { className: "text-red-600 dark:text-red-500 cursor-pointer", onClick: o, disabled: l.isPending, children: i("div", { className: "flex items-center gap-2", children: [l.isPending ? e(de, { className: "w-4 h-4" }) : e(Yt, { className: "w-4 h-4" }), l.isPending ? "Deleting..." : "Delete"] }) })] })] });
|
|
2124
|
+
}, Fm = [Be.display({ id: "select", header: ({ table: a }) => e(Oe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Oe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), Be.accessor("id", { header: ({ column: a }) => e(P, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
2125
2125
|
var n, s, l;
|
|
2126
2126
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
2127
2127
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.productEdit(r, a.getValue("id"))) ?? `/admin/${r}/products/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
2128
2128
|
} }), Be.accessor("title", { header: ({ column: a }) => e(P, { column: a, title: "Title" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" } }), Be.accessor("sku", { header: ({ column: a }) => e(P, { column: a, title: "SKU" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "SKU" }, cell: ({ row: a }) => a.getValue("sku") || "-" }), Be.accessor("basePrice", { header: ({ column: a }) => e(P, { column: a, title: "Base Price" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Base Price" }, cell: ({ row: a }) => `$${a.getValue("basePrice").toFixed(2)}` }), Be.accessor("discountedBasePrice", { header: ({ column: a }) => e(P, { column: a, title: "Discounted Price" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Discounted Price" }, cell: ({ row: a }) => {
|
|
2129
2129
|
const t = a.getValue("discountedBasePrice");
|
|
2130
2130
|
return t ? `$${t.toFixed(2)}` : "-";
|
|
2131
|
-
} }), Be.accessor("publishedAt", { header: ({ column: a }) => e(P, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" }, cell: ({ row: a, table: t }) => e(
|
|
2131
|
+
} }), Be.accessor("publishedAt", { header: ({ column: a }) => e(P, { column: a, title: "Status" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "Slug" }, cell: ({ row: a, table: t }) => e(zm, { row: a, table: t }) }), Be.accessor("createdAt", { header: ({ column: a }) => e(P, { column: a, title: "Created At" }), enableSorting: !1, meta: { className: "text-left", displayName: "Created At" }, cell: ({ row: a }) => {
|
|
2132
2132
|
const t = a.getValue("createdAt");
|
|
2133
2133
|
return new Date(t).toLocaleDateString();
|
|
2134
|
-
} }), Be.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(
|
|
2134
|
+
} }), Be.display({ id: "edit", header: "Edit", enableSorting: !1, enableHiding: !1, meta: { className: "text-right", displayName: "Edit" }, cell: ({ row: a, table: t }) => e(Dm, { row: a, table: t }) })], Rm = () => {
|
|
2135
2135
|
const { client: a } = I(), t = K(), { defaultLocale: r } = be(), n = U(), s = We(), l = _(), o = fe(), [d, u] = F(""), [c, h] = F("all"), [p, g] = F("all"), [b] = qe(d, 300), f = Number((o == null ? void 0 : o.get("page")) || "1"), w = c === "all" ? void 0 : c, y = p === "all" ? void 0 : p, k = (B, J) => {
|
|
2136
2136
|
const Se = new URLSearchParams(o == null ? void 0 : o.toString());
|
|
2137
2137
|
return Se.set(B, J), Se.toString();
|
|
@@ -2152,12 +2152,12 @@ const Be = ua(), Em = ({ row: a, table: t }) => {
|
|
|
2152
2152
|
h(B), v();
|
|
2153
2153
|
}, children: [e(ot, { className: "w-full sm:w-[220px]", children: e(lt, { placeholder: "All categories" }) }), i(dt, { children: [e(Qe, { value: "all", children: "All categories" }), N.map((B) => e(Qe, { value: B.value, children: B.label }, B.value))] })] }), i(st, { value: p, onValueChange: (B) => {
|
|
2154
2154
|
g(B), v();
|
|
2155
|
-
}, children: [e(ot, { className: "w-full sm:w-[190px]", children: e(lt, { placeholder: "All statuses" }) }), i(dt, { children: [e(Qe, { value: "all", children: "All statuses" }), e(Qe, { value: "published", children: "Published" }), e(Qe, { value: "unpublished", children: "Unpublished" })] })] })] }), e("div", { className: "flex items-center gap-2", children: e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCreate(n), children: ["Create Product", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ba, { error: D, loading: R || T, meta: H != null && H.meta ? { ...H == null ? void 0 : H.meta, currentPage: f } : void 0, data: (H == null ? void 0 : H.list) || [], columns:
|
|
2155
|
+
}, children: [e(ot, { className: "w-full sm:w-[190px]", children: e(lt, { placeholder: "All statuses" }) }), i(dt, { children: [e(Qe, { value: "all", children: "All statuses" }), e(Qe, { value: "published", children: "Published" }), e(Qe, { value: "unpublished", children: "Unpublished" })] })] })] }), e("div", { className: "flex items-center gap-2", children: e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.productCreate(n), children: ["Create Product", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) }) })] }), e(ba, { error: D, loading: R || T, meta: H != null && H.meta ? { ...H == null ? void 0 : H.meta, currentPage: f } : void 0, data: (H == null ? void 0 : H.list) || [], columns: Fm, className: "mt-8", refetch: le })] });
|
|
2156
2156
|
};
|
|
2157
|
-
function
|
|
2158
|
-
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Products" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(
|
|
2157
|
+
function Bm() {
|
|
2158
|
+
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Products" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(Rm, {}) })] });
|
|
2159
2159
|
}
|
|
2160
|
-
const
|
|
2160
|
+
const Mm = ({ organizationId: a, id: t, acceptedAt: r, cancelledAt: n, refetch: s }) => {
|
|
2161
2161
|
var p;
|
|
2162
2162
|
const { client: l } = I(), o = L({ mutationFn: async ({ operation: g }) => {
|
|
2163
2163
|
if ((await l.reservation.updateReservationStatus({ params: { organizationId: a, reservationId: t, operation: g }, body: {} })).status !== 200) throw new Error("Failed to update reservation status");
|
|
@@ -2168,14 +2168,14 @@ const Bm = ({ organizationId: a, id: t, acceptedAt: r, cancelledAt: n, refetch:
|
|
|
2168
2168
|
o.mutate({ operation: "cancel" });
|
|
2169
2169
|
}, c = o.isPending, h = (p = o.variables) == null ? void 0 : p.operation;
|
|
2170
2170
|
return i("div", { className: "flex items-center gap-2 min-w-28 min-h-[45px]", children: [!n && i("button", { onClick: u, disabled: c, className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", children: [c && h === "cancel" ? "Loading..." : "Cancel", e(za, { className: "w-4 h-4 text-red-600 dark:text-red-500" })] }), !r && !n && i("button", { onClick: d, disabled: c, className: "relative my-2 inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md border px-2 py-1 text-center text-sm font-medium shadow-xs transition-all duration-100 ease-in-out disabled:pointer-events-none disabled:shadow-none outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500 dark:outline-blue-500 border-gray-300 dark:border-gray-800 text-gray-900 dark:text-gray-50 bg-white dark:bg-gray-950 hover:bg-gray-50 dark:hover:bg-gray-900/60 disabled:text-gray-400 dark:disabled:text-gray-600", children: [c && h === "accept" ? "Loading..." : "Accept", e(ut, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-500" })] })] });
|
|
2171
|
-
},
|
|
2171
|
+
}, Pm = ({ open: a, onOpenChange: t, reservation: r }) => e(Ct, { open: a, onOpenChange: t, children: i(St, { className: "sm:max-w-[500px] overflow-y-auto max-h-[85vh]", children: [e(kn, { children: e(mr, { children: "Reservation Details" }) }), i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 py-4", children: [i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Reference ID" }), e("p", { className: "text-sm font-medium", children: r.referenceId })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Status" }), e("p", { className: "text-sm font-medium", children: r.cancelledAt ? "Cancelled" : r.acceptedAt ? "Accepted" : "Pending" })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Customer Name" }), e("p", { className: "text-sm font-medium", children: `${r.firstname} ${r.lastname}` })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Phone" }), e("p", { className: "text-sm font-medium", children: r.phone || "N/A" })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Number of Guests" }), e("p", { className: "text-sm font-medium", children: r.guests })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Reservation Date" }), e("p", { className: "text-sm font-medium", children: r.date ? q(new Date(r.date), "PPpp") : "N/A" })] }), i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Created At" }), e("p", { className: "text-sm font-medium", children: r.createdAt ? q(new Date(r.createdAt), "PPpp") : "N/A" })] }), r.acceptedAt && i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Accepted At" }), e("p", { className: "text-sm font-medium", children: q(new Date(r.acceptedAt), "PPpp") })] }), r.cancelledAt && i("div", { className: "space-y-1", children: [e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: "Cancelled At" }), e("p", { className: "text-sm font-medium", children: q(new Date(r.cancelledAt), "PPpp") })] })] })] }) }), Qm = ({ reservation: a }) => {
|
|
2172
2172
|
const [t, r] = F(!1);
|
|
2173
|
-
return i(C, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(
|
|
2174
|
-
},
|
|
2173
|
+
return i(C, { children: [e("button", { onClick: () => r(!0), className: "text-blue-500 hover:underline", children: String(a.id).slice(-5) }), e(Pm, { open: t, onOpenChange: r, reservation: a })] });
|
|
2174
|
+
}, Tm = ({ reservation: a, table: t }) => {
|
|
2175
2175
|
const r = t.options.meta, n = (r == null ? void 0 : r.organizationId) || "", s = typeof (r == null ? void 0 : r.refetch) == "function" ? r.refetch : () => {
|
|
2176
2176
|
};
|
|
2177
|
-
return e(
|
|
2178
|
-
}, Me = ua(),
|
|
2177
|
+
return e(Mm, { organizationId: n, id: a.id, acceptedAt: a.acceptedAt, cancelledAt: a.cancelledAt, refetch: s });
|
|
2178
|
+
}, Me = ua(), Jm = [Me.accessor("id", { header: ({ column: a }) => e(P, { column: a, title: "ID" }), meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a }) => e(Qm, { reservation: a.original }), enableSorting: !0, enableHiding: !1 }), Me.accessor("referenceId", { header: ({ column: a }) => e(P, { column: a, title: "Reference ID" }), cell: ({ row: a }) => e("div", { className: "w-[100px]", children: a.getValue("referenceId") }), meta: { className: "text-left", displayName: "Reference ID" }, enableSorting: !1, enableHiding: !1 }), Me.display({ id: "customer", meta: { className: "text-left", displayName: "Customer" }, header: ({ column: a }) => e(P, { column: a, title: "Customer" }), cell: ({ row: a }) => {
|
|
2179
2179
|
const t = a.original.firstname || "", r = a.original.lastname || "";
|
|
2180
2180
|
return e("div", { children: `${t} ${r}`.trim() || "N/A" });
|
|
2181
2181
|
} }), Me.accessor("guests", { meta: { className: "text-left", displayName: "Guests" }, enableSorting: !0, enableHiding: !1, header: ({ column: a }) => e(P, { column: a, title: "Guests" }), cell: ({ row: a }) => e("div", { className: "font-medium", children: a.original.guests }) }), Me.accessor("phone", { meta: { className: "text-left", displayName: "Phone" }, enableSorting: !1, enableHiding: !1, header: ({ column: a }) => e(P, { column: a, title: "Phone" }), cell: ({ row: a }) => e("div", { children: a.original.phone || "N/A" }) }), Me.accessor("date", { meta: { className: "text-left", displayName: "Reservation Date" }, enableSorting: !0, enableHiding: !1, header: ({ column: a }) => e(P, { column: a, title: "Reservation Date" }), cell: ({ row: a }) => {
|
|
@@ -2187,18 +2187,18 @@ const Bm = ({ organizationId: a, id: t, acceptedAt: r, cancelledAt: n, refetch:
|
|
|
2187
2187
|
} }), Me.display({ id: "status", meta: { className: "text-left", displayName: "Status" }, header: ({ column: a }) => e(P, { column: a, title: "Status" }), cell: ({ row: a }) => {
|
|
2188
2188
|
const t = a.original.acceptedAt;
|
|
2189
2189
|
return a.original.cancelledAt ? e("div", { className: "text-red-600 font-medium", children: "Cancelled" }) : t ? e("div", { className: "text-green-600 font-medium", children: "Accepted" }) : e("div", { className: "text-yellow-600 font-medium", children: "Pending" });
|
|
2190
|
-
} }), Me.display({ id: "actions", header: ({ column: a }) => e(P, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(
|
|
2190
|
+
} }), Me.display({ id: "actions", header: ({ column: a }) => e(P, { column: a, title: "Actions" }), cell: ({ row: a, table: t }) => e(Tm, { reservation: a.original, table: t }) })], Om = () => {
|
|
2191
2191
|
const { client: a } = I(), t = U(), r = fe(), [n, s] = F(""), [l] = qe(n, 300), o = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: d, isRefetching: u, isError: c, data: h, refetch: p } = Q({ queryKey: ["reservations", t, o, l], queryFn: async () => {
|
|
2192
2192
|
const { body: g, status: b } = await a.reservation.getReservations({ params: { organizationId: t }, query: { page: o, limit: 10, search: l } });
|
|
2193
2193
|
if (b !== 200) throw new Error("Failed to fetch reservations");
|
|
2194
2194
|
return g;
|
|
2195
2195
|
}, placeholderData: he });
|
|
2196
|
-
return i(C, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(xa, { type: "search", placeholder: "Search by name or reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ba, { error: c, loading: d || u, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns:
|
|
2196
|
+
return i(C, { children: [e("div", { className: "flex flex-wrap items-center justify-between gap-2 sm:gap-x-6", children: e("div", { className: "flex w-full flex-col gap-2 sm:w-fit sm:flex-row sm:items-center", children: e(xa, { type: "search", placeholder: "Search by name or reference...", value: n, onChange: (g) => s(g.target.value), className: "w-full sm:max-w-[250px] sm:[&>input]:h-[40px]" }) }) }), e(ba, { error: c, loading: d || u, meta: h != null && h.meta ? { ...h == null ? void 0 : h.meta, currentPage: o } : void 0, data: (h == null ? void 0 : h.list) || [], columns: Jm, className: "mt-8", refetch: p })] });
|
|
2197
2197
|
};
|
|
2198
|
-
function
|
|
2199
|
-
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Reservations List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(
|
|
2198
|
+
function Lm() {
|
|
2199
|
+
return i(C, { children: [e("h1", { className: "text-xl font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Reservations List" }), e("div", { className: "mt-4 sm:mt-6 lg:mt-6", children: e(Om, {}) })] });
|
|
2200
2200
|
}
|
|
2201
|
-
const
|
|
2201
|
+
const jm = [{ label: "Owner", value: "owner" }, { label: "Admin", value: "admin" }, { label: "Member", value: "member" }], hs = ({ initialData: a }) => {
|
|
2202
2202
|
const { client: t } = I(), r = _(), n = K(), s = U(), l = !!a, o = me({ resolver: ue(l ? so : no), defaultValues: l ? { role: a.role } : { email: "", role: "member" } }), d = L({ mutationFn: async (p) => {
|
|
2203
2203
|
const { status: g } = await t.access.createInvitation({ params: { organizationId: s }, body: p });
|
|
2204
2204
|
if (g !== 201) throw new Error("Failed to create invitation");
|
|
@@ -2210,12 +2210,12 @@ const Lm = [{ label: "Owner", value: "owner" }, { label: "Admin", value: "admin"
|
|
|
2210
2210
|
}, h = (p) => {
|
|
2211
2211
|
l ? u.mutate({ role: p.role }, { onSuccess: c }) : d.mutate(p, { onSuccess: c });
|
|
2212
2212
|
};
|
|
2213
|
-
return e(Ue, { ...o, children: i("form", { onSubmit: o.handleSubmit((p) => h(p)), className: "space-y-14", children: [e("section", { "aria-labelledby": "access-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "access-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: l ? "Edit Member Role" : "Invite User" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: l ? `Update the role for ${a.user.firstname} ${a.user.lastname}` : "Send an invitation to a new team member" })] }), i("div", { className: "md:col-span-2", children: [l && i("div", { className: "mb-5", children: [e(ke, { htmlFor: "member-email", className: "font-medium", children: "Email" }), e(pe, { id: "member-email", value: a.user.email, disabled: !0, readOnly: !0, className: "w-full mt-2" })] }), e(ze, { form: o, config: [...l ? [] : [{ name: "email", label: "Email", type: "email", placeholder: "user@example.com", colspan: 2 }], { name: "role", label: "Role", type: "select", options:
|
|
2213
|
+
return e(Ue, { ...o, children: i("form", { onSubmit: o.handleSubmit((p) => h(p)), className: "space-y-14", children: [e("section", { "aria-labelledby": "access-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "access-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: l ? "Edit Member Role" : "Invite User" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: l ? `Update the role for ${a.user.firstname} ${a.user.lastname}` : "Send an invitation to a new team member" })] }), i("div", { className: "md:col-span-2", children: [l && i("div", { className: "mb-5", children: [e(ke, { htmlFor: "member-email", className: "font-medium", children: "Email" }), e(pe, { id: "member-email", value: a.user.email, disabled: !0, readOnly: !0, className: "w-full mt-2" })] }), e(ze, { form: o, config: [...l ? [] : [{ name: "email", label: "Email", type: "email", placeholder: "user@example.com", colspan: 2 }], { name: "role", label: "Role", type: "select", options: jm, colspan: 2 }] })] })] }) }), e(W, {}), i("div", { className: "flex justify-end space-x-3", children: [i(z, { type: "button", variant: "secondary", onClick: () => r.push(n.settingsAccess(s)), children: [e(Da, { className: "w-4 h-4 mr-2" }), " Cancel"] }), i(z, { type: "submit", isLoading: d.isPending || u.isPending, loadingText: "Saving...", children: [e(pt, { className: "w-4 h-4 mr-2" }), " ", l ? "Save Role" : "Send Invitation"] })] })] }) });
|
|
2214
2214
|
};
|
|
2215
|
-
function
|
|
2216
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Invite User" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(
|
|
2215
|
+
function Vm() {
|
|
2216
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Invite User" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(hs, {}) }) })] });
|
|
2217
2217
|
}
|
|
2218
|
-
const
|
|
2218
|
+
const Zm = () => {
|
|
2219
2219
|
var h;
|
|
2220
2220
|
const { client: a } = I(), t = U(), r = K(), n = fe(), [s] = F(""), [l] = qe(s, 300), o = Number((n == null ? void 0 : n.get("page")) || "1"), d = L({ mutationFn: async (p) => {
|
|
2221
2221
|
const { status: g } = await a.access.deleteMember({ params: { organizationId: t, memberId: p } });
|
|
@@ -2233,7 +2233,7 @@ const Vm = () => {
|
|
|
2233
2233
|
const g = p.user.firstname.charAt(0).toUpperCase() + p.user.lastname.charAt(0).toUpperCase();
|
|
2234
2234
|
return i("li", { className: "flex items-center justify-between gap-x-6 py-2.5", children: [i("div", { className: "flex items-center gap-x-4 truncate", children: [e("span", { className: "hidden size-9 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 sm:flex dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: g }), i("div", { className: "truncate", children: [i("p", { className: "truncate text-sm font-medium text-gray-900 dark:text-gray-50", children: [p.user.firstname, " ", p.user.lastname] }), e("p", { className: "truncate text-xs text-gray-500", children: p.user.email })] })] }), i("div", { className: "flex items-center gap-x-4", children: [e("span", { className: "inline-flex items-center rounded-md bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-gray-800 dark:text-gray-400", children: p.role.charAt(0).toUpperCase() + p.role.slice(1) }), e(E, { href: r.settingsAccessMemberEdit(t, p.id), className: "text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300", children: "Edit" }), e("button", { onClick: () => d.mutate(p.id), disabled: d.isPending, className: "text-sm font-medium text-red-600 hover:text-red-500 dark:text-red-400 dark:hover:text-red-300 disabled:opacity-50", children: "Delete" })] })] }, p.id);
|
|
2235
2235
|
}) }) : e("p", { className: "text-sm text-gray-500 py-4 mt-4", children: "No members found." });
|
|
2236
|
-
},
|
|
2236
|
+
}, Hm = () => {
|
|
2237
2237
|
const { client: a } = I(), t = U(), { isLoading: r, data: n } = Q({ queryKey: ["access-invitations", t], queryFn: async () => {
|
|
2238
2238
|
const { body: l, status: o } = await a.access.getInvitations({ params: { organizationId: t } });
|
|
2239
2239
|
if (o !== 200) throw new Error("Failed to fetch invitations");
|
|
@@ -2246,38 +2246,38 @@ const Vm = () => {
|
|
|
2246
2246
|
}, onError: (l) => {
|
|
2247
2247
|
O.error((l == null ? void 0 : l.message) || "Failed to revoke invitation");
|
|
2248
2248
|
} });
|
|
2249
|
-
return r ? e("div", { className: "flex items-center justify-center h-24", children: e(de, { className: "w-6 h-6" }) }) : !n || n.length === 0 ? e("p", { className: "text-sm text-gray-500 py-4", children: "No pending invitations." }) : e("div", { className: "relative overflow-hidden overflow-x-auto", children: i(
|
|
2249
|
+
return r ? e("div", { className: "flex items-center justify-center h-24", children: e(de, { className: "w-6 h-6" }) }) : !n || n.length === 0 ? e("p", { className: "text-sm text-gray-500 py-4", children: "No pending invitations." }) : e("div", { className: "relative overflow-hidden overflow-x-auto", children: i(Rr, { children: [e(Br, { children: i(ra, { className: "border-y border-gray-200 dark:border-gray-800", children: [e(aa, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Email" }), e(aa, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Role" }), e(aa, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Status" }), e(aa, { className: "whitespace-nowrap py-1 text-sm sm:text-xs", children: "Expires" }), e(aa, { className: "whitespace-nowrap py-1 text-sm sm:text-xs text-right", children: "Actions" })] }) }), e(Mr, { children: n.map((l) => i(ra, { className: "group select-none hover:bg-gray-50 dark:hover:bg-gray-900", children: [e(Pe, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: l.email }), e(Pe, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: e("span", { className: "inline-flex items-center rounded-md bg-gray-100 px-2 py-0.5 text-xs font-medium text-gray-600 dark:bg-gray-800 dark:text-gray-400", children: l.role ? l.role.charAt(0).toUpperCase() + l.role.slice(1) : "-" }) }), e(Pe, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: e("span", { className: "inline-flex items-center rounded-md bg-yellow-50 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400", children: l.status.charAt(0).toUpperCase() + l.status.slice(1) }) }), e(Pe, { className: "whitespace-nowrap py-1 text-gray-600 dark:text-gray-400", children: new Date(l.expiresAt).toLocaleDateString() }), e(Pe, { className: "whitespace-nowrap py-1 text-right", children: e("button", { onClick: () => s.mutate(l.id), disabled: s.isPending, className: "inline-flex items-center rounded-md p-1 text-gray-400 hover:text-red-600 hover:bg-red-50 dark:hover:text-red-400 dark:hover:bg-red-900/20 transition disabled:opacity-50", children: e(Yt, { className: "w-4 h-4" }) }) })] }, l.id)) })] }) });
|
|
2250
2250
|
};
|
|
2251
|
-
function
|
|
2251
|
+
function Um() {
|
|
2252
2252
|
const a = U(), t = K();
|
|
2253
|
-
return i(C, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Members" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Manage team members and their roles within your organization." })] }), e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsAccessInvite(a), children: ["Invite User", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(
|
|
2253
|
+
return i(C, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Members" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Manage team members and their roles within your organization." })] }), e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsAccessInvite(a), children: ["Invite User", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(Zm, {}), i("div", { className: "mt-12", children: [e("h3", { className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Pending Invitations" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Invitations that have been sent but not yet accepted." }), e("div", { className: "mt-4", children: e(Hm, {}) })] })] });
|
|
2254
2254
|
}
|
|
2255
|
-
function
|
|
2255
|
+
function qm() {
|
|
2256
2256
|
const a = U(), t = Qa(), { client: r } = I(), { isLoading: n, data: s } = Q({ queryKey: ["access-members", a, t], queryFn: async () => {
|
|
2257
2257
|
const { status: l, body: o } = await r.access.getMember({ params: { organizationId: a, memberId: t } });
|
|
2258
2258
|
if (l !== 200) throw O.error("Failed to fetch member. Please refresh or try again later."), new Error("Failed to fetch member");
|
|
2259
2259
|
return o;
|
|
2260
2260
|
}, throwOnError: !0, placeholderData: he });
|
|
2261
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Member" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(
|
|
2261
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Member" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(hs, { initialData: s }) }) })] });
|
|
2262
2262
|
}
|
|
2263
|
-
const
|
|
2263
|
+
const Wm = [{ name: "configuration.openingTimes.monday", label: "Monday", type: "time" }, { name: "configuration.closingTimes.monday", label: "", type: "time" }, { name: "configuration.openingTimes.tuesday", label: "Tuesday", type: "time" }, { name: "configuration.closingTimes.tuesday", label: "", type: "time" }, { name: "configuration.openingTimes.wednesday", label: "Wednesday", type: "time" }, { name: "configuration.closingTimes.wednesday", label: "", type: "time" }, { name: "configuration.openingTimes.thursday", label: "Thursday", type: "time" }, { name: "configuration.closingTimes.thursday", label: "", type: "time" }, { name: "configuration.openingTimes.friday", label: "Friday", type: "time" }, { name: "configuration.closingTimes.friday", label: "", type: "time" }, { name: "configuration.openingTimes.saturday", label: "Saturday", type: "time" }, { name: "configuration.closingTimes.saturday", label: "", type: "time" }, { name: "configuration.openingTimes.sunday", label: "Sunday", type: "time" }, { name: "configuration.closingTimes.sunday", label: "", type: "time" }, { name: "configuration.isAcceptingOrders", label: "Accepting Orders", type: "switch" }], _m = ({ onClose: a, initialData: t }) => {
|
|
2264
2264
|
var o, d, u, c, h, p;
|
|
2265
|
-
const { client: r } = I(), n = me({ resolver: ue(
|
|
2265
|
+
const { client: r } = I(), n = me({ resolver: ue(dr), defaultValues: { configuration: { defaultLocale: (o = t == null ? void 0 : t.configuration) == null ? void 0 : o.defaultLocale, supportedLocales: (d = t == null ? void 0 : t.configuration) == null ? void 0 : d.supportedLocales, defaultCurrency: (u = t == null ? void 0 : t.configuration) == null ? void 0 : u.defaultCurrency, openingTimes: (c = t == null ? void 0 : t.configuration) == null ? void 0 : c.openingTimes, closingTimes: (h = t == null ? void 0 : t.configuration) == null ? void 0 : h.closingTimes, isAcceptingOrders: (p = t == null ? void 0 : t.configuration) == null ? void 0 : p.isAcceptingOrders } } });
|
|
2266
2266
|
console.log(n.watch());
|
|
2267
2267
|
const { isPending: s, mutate: l } = L({ mutationFn: async ({ configuration: g }) => {
|
|
2268
2268
|
const { status: b } = await r.organization.updateOrganization({ params: { organizationId: t == null ? void 0 : t.id }, body: { configuration: g } });
|
|
2269
2269
|
if (b !== 200) throw O.error("Failed to update organization. Please try again later."), new Error("Failed to update organization");
|
|
2270
2270
|
return await se.invalidateQueries({ queryKey: ["organizations"] }), a && a();
|
|
2271
2271
|
} });
|
|
2272
|
-
return e(ze, { form: n, config:
|
|
2272
|
+
return e(ze, { form: n, config: Wm, onSubmit: (g) => l(g), onCancel: a, loading: s, cancelText: "Go back", okText: "Save Schedule" });
|
|
2273
2273
|
};
|
|
2274
|
-
function
|
|
2274
|
+
function $m() {
|
|
2275
2275
|
const { organization: a } = be();
|
|
2276
|
-
return a.data ? e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "opening-times", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "opening-times", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Opening and Closing Times" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the opening and closing times for your organization" })] }), e("div", { className: "md:col-span-2", children: e(
|
|
2276
|
+
return a.data ? e("div", { className: "space-y-10", children: e("section", { "aria-labelledby": "opening-times", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "opening-times", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Opening and Closing Times" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the opening and closing times for your organization" })] }), e("div", { className: "md:col-span-2", children: e(_m, { initialData: a.data }) })] }) }) }) : e("div", { children: "Loading..." });
|
|
2277
2277
|
}
|
|
2278
|
-
const
|
|
2278
|
+
const gs = ({ initialData: a }) => {
|
|
2279
2279
|
var h;
|
|
2280
|
-
const { client: t } = I(), r = _(), n = K(), s = U(), l = me({ resolver: ue(a ? wo :
|
|
2280
|
+
const { client: t } = I(), r = _(), n = K(), s = U(), l = me({ resolver: ue(a ? wo : hn), defaultValues: a ? { title: a.title, providerName: a.providerName, providerLogoId: (h = a.providerLogo) == null ? void 0 : h.id, requireDateOfDelivery: a.requireDateOfDelivery, shippingZones: a.shippingZones } : { shippingZones: [{}] } }), o = L({ mutationFn: async (p) => {
|
|
2281
2281
|
const { status: g } = await t.shippingMethod.createShippingMethod({ params: { organizationId: s }, body: p });
|
|
2282
2282
|
if (g !== 201) throw O.error("Failed to create shipping method. Please try again later."), new Error("Failed to create shipping method");
|
|
2283
2283
|
} }), d = L({ mutationFn: async (p) => {
|
|
@@ -2290,18 +2290,18 @@ const fs = ({ initialData: a }) => {
|
|
|
2290
2290
|
};
|
|
2291
2291
|
return e(Ue, { ...l, children: i("form", { onSubmit: l.handleSubmit((p) => c(p)), className: "space-y-14", children: [e("section", { "aria-labelledby": "Basic Information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Basic Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Enter the information about your shipping method including title, shipping provider's name and logo" })] }), e("div", { className: "md:col-span-2", children: e(ze, { form: l, config: [{ name: "title", label: "Title", type: "text", placeholder: "Standard Shipping", colspan: 2 }, { name: "providerName", label: "Provider Name", type: "text", placeholder: "FedEx", colspan: 2 }, { name: "providerLogoId", label: "Provider Logo", type: "file" }, { name: "requireDateOfDelivery", label: "Require Date of Delivery?", type: "switch", colspan: 2 }] }) })] }) }), e(W, {}), e("section", { "aria-labelledby": "product-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "product-information", className: "text-lg scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Shipping Zones" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set pricing and minimum order based on delivery zones" })] }), e("div", { className: "md:col-span-2", children: e(ze, { form: l, config: [{ name: "shippingZones", type: "array", fields: [{ name: "title", label: "Title", type: "text", placeholder: "Zone 1" }, { name: "distanceUpto", label: "Distance To (km)", type: "number", placeholder: "10" }, { name: "price", label: "Shipping Price", type: "number", placeholder: "5.99", prefix: "USD" }, { name: "minimumOrderAmount", label: "Minimum Order Amount", type: "number", placeholder: "50", prefix: "USD" }, { name: "eta", label: "Estimated Time of Arrival", type: "text", placeholder: "2-3 days" }] }] }) })] }) }), e(W, {}), i("div", { className: "flex justify-end space-x-3", children: [i(z, { type: "button", variant: "secondary", onClick: () => r.push(n.settingsShippingMethods(s)), children: [e(Da, { className: "w-4 h-4 mr-2" }), " Cancel"] }), i(z, { type: "submit", isLoading: o.isPending || d.isPending, loadingText: "Saving...", children: [e(pt, { className: "w-4 h-4 mr-2" }), " ", a ? "Save Product" : "Create Shipping Method"] })] })] }) });
|
|
2292
2292
|
};
|
|
2293
|
-
function $m() {
|
|
2294
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Shipping Method" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(fs, {}) }) })] });
|
|
2295
|
-
}
|
|
2296
2293
|
function Gm() {
|
|
2294
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Create Shipping Method" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: e(gs, {}) }) })] });
|
|
2295
|
+
}
|
|
2296
|
+
function Km() {
|
|
2297
2297
|
const a = U(), t = Qa(), { client: r } = I(), { isLoading: n, data: s } = Q({ queryKey: ["shipping-and-payment", a, t], queryFn: async () => {
|
|
2298
2298
|
const { status: l, body: o } = await r.shippingMethod.getShippingMethod({ params: { id: t, organizationId: a } });
|
|
2299
2299
|
if (l !== 200) throw O.error("Failed to fetch shipping method. Please refresh or try again later."), new Error("Failed to fetch shipping method");
|
|
2300
2300
|
return o;
|
|
2301
2301
|
}, throwOnError: !0, placeholderData: he });
|
|
2302
|
-
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Shipping Method" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(
|
|
2302
|
+
return i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-xl dark:text-gray-50", children: "Edit Shipping Method" }), e(W, {}), e("div", { className: "pt-6", children: e("div", { className: "space-y-10", children: n || !s ? e("div", { className: "flex justify-center items-center h-screen mt-5", children: i("div", { className: "flex flex-col items-center gap-2", children: [e(de, { className: "w-12 h-12" }), e("p", { className: "text-gray-500 text-sm mt-3", children: "Loading data..." })] }) }) : e(gs, { initialData: s }) }) })] });
|
|
2303
2303
|
}
|
|
2304
|
-
const oa = ua(),
|
|
2304
|
+
const oa = ua(), Ym = [oa.display({ id: "select", header: ({ table: a }) => e(Oe, { checked: a.getIsAllPageRowsSelected() ? !0 : a.getIsSomeRowsSelected() ? "indeterminate" : !1, onCheckedChange: () => a.toggleAllPageRowsSelected(), className: "translate-y-0.5", "aria-label": "Select all" }), cell: ({ row: a }) => e(Oe, { checked: a.getIsSelected(), onCheckedChange: () => a.toggleSelected(), className: "translate-y-0.5", "aria-label": "Select row" }), enableSorting: !1, enableHiding: !1, meta: { displayName: "Select" } }), oa.accessor("id", { header: ({ column: a }) => e(P, { column: a, title: "Id" }), enableSorting: !0, enableHiding: !1, meta: { className: "text-left", displayName: "ID" }, cell: ({ row: a, table: t }) => {
|
|
2305
2305
|
var n, s, l;
|
|
2306
2306
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
2307
2307
|
return e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.settingsShippingMethodEdit(r, a.getValue("id"))) ?? `/admin/${r}/settings/shipping-methods/${a.getValue("id")}`, className: "text-blue-500", children: a.getValue("id") });
|
|
@@ -2309,32 +2309,32 @@ const oa = ua(), Km = [oa.display({ id: "select", header: ({ table: a }) => e(Oe
|
|
|
2309
2309
|
var n, s, l;
|
|
2310
2310
|
const r = (n = t.options.meta) == null ? void 0 : n.organizationId;
|
|
2311
2311
|
return i($e, { children: [e(Ge, { asChild: !0, children: e(z, { variant: "ghost", className: "group aspect-square px-1.5 py-0! h-8! hover:border hover:border-gray-300 data-[state=open]:border-gray-300 data-[state=open]:bg-gray-50 dark:hover:border-gray-700 dark:data-[state=open]:border-gray-700 dark:data-[state=open]:bg-gray-900", children: e(yt, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 group-data-[state=open]:text-gray-700 dark:group-hover:text-gray-300 dark:group-data-[state=open]:text-gray-300", "aria-hidden": "true" }) }) }), i(Ke, { align: "end", className: "min-w-40", children: [e(Ae, { children: e(E, { href: ((l = (s = t.options.meta) == null ? void 0 : s.routes) == null ? void 0 : l.settingsShippingMethodEdit(r, a.getValue("id"))) ?? `/admin/${r}/settings/shipping-methods/${a.getValue("id")}`, className: "block", children: "Edit" }) }), e(Ae, { className: "text-red-600 dark:text-red-500", children: "Delete" })] })] });
|
|
2312
|
-
} })],
|
|
2312
|
+
} })], Xm = () => {
|
|
2313
2313
|
const { client: a } = I(), t = U(), r = fe(), [n] = F(""), [s] = qe(n, 300), l = Number((r == null ? void 0 : r.get("page")) || "1"), { isLoading: o, isRefetching: d, isError: u, data: c } = Q({ queryKey: ["shipping-and-payment", t, l, s], queryFn: async () => {
|
|
2314
2314
|
const { body: h, status: p } = await a.shippingMethod.getShippingMethods({ params: { organizationId: t }, query: { page: l, limit: 10, search: s } });
|
|
2315
2315
|
if (p !== 200) throw new Error("Failed to fetch shipping methods");
|
|
2316
2316
|
return h;
|
|
2317
2317
|
}, placeholderData: he });
|
|
2318
|
-
return e("div", { children: e(ba, { error: u, loading: o || d, meta: c != null && c.meta ? { ...c == null ? void 0 : c.meta, currentPage: l } : void 0, data: (c == null ? void 0 : c.list) || [], columns:
|
|
2318
|
+
return e("div", { children: e(ba, { error: u, loading: o || d, meta: c != null && c.meta ? { ...c == null ? void 0 : c.meta, currentPage: l } : void 0, data: (c == null ? void 0 : c.list) || [], columns: Ym, className: "mt-8" }) });
|
|
2319
2319
|
};
|
|
2320
|
-
function
|
|
2320
|
+
function eu() {
|
|
2321
2321
|
const a = U(), t = K();
|
|
2322
|
-
return i(C, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { id: "existing-users", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Shipping Methods" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Set up delivery zones, pricing based on distance, and manage shipping methods and providers for your organization." })] }), e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsShippingMethodCreate(a), children: ["Create Shipping Method", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(
|
|
2322
|
+
return i(C, { children: [i("div", { className: "sm:flex sm:items-center sm:justify-between", children: [i("div", { children: [e("h3", { id: "existing-users", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Shipping Methods" }), e("p", { className: "text-sm leading-6 text-gray-500", children: "Set up delivery zones, pricing based on distance, and manage shipping methods and providers for your organization." })] }), e(z, { asChild: !0, className: "hidden gap-x-2 px-2 py-1.5 text-sm sm:text-xs lg:flex", children: i(E, { href: t.settingsShippingMethodCreate(a), children: ["Create Shipping Method", e(Te, { className: "size-4 shrink-0", "aria-hidden": "true" })] }) })] }), e(Xm, {})] });
|
|
2323
2323
|
}
|
|
2324
2324
|
function Ve({ children: a }) {
|
|
2325
2325
|
const t = We(), r = U(), n = K(), s = [{ name: "General", href: n.settings(r) }, { name: "Shipping Methods", href: n.settingsShippingMethods(r) }, { name: "Opening Times", href: n.settingsOpeningTimes(r) }, { name: "Access", href: n.settingsAccess(r) }, { name: "API Keys", href: `${n.settings(r)}/api-keys` }];
|
|
2326
|
-
return t != null && t.match(/\/settings\/shipping-methods\/[^/]+$/) || t != null && t.match(/\/settings\/access\/[^/]+$/) ? e("div", { children: a }) : i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Settings" }), e(
|
|
2326
|
+
return t != null && t.match(/\/settings\/shipping-methods\/[^/]+$/) || t != null && t.match(/\/settings\/access\/[^/]+$/) ? e("div", { children: a }) : i("div", { children: [e("h1", { className: "text-lg font-semibold text-gray-900 sm:text-2xl dark:text-gray-50", children: "Settings" }), e(Dr, { className: "mt-4 sm:mt-6 lg:mt-6", children: s.map((l) => e(Fr, { asChild: !0, active: t === l.href, children: e(E, { href: l.href, children: l.name }) }, l.name)) }), e("div", { className: "pt-6", children: a })] });
|
|
2327
2327
|
}
|
|
2328
|
-
const
|
|
2328
|
+
const au = [{ name: "configuration.defaultLocale", label: "Default Locale", type: "select", placeholder: "", options: Hr }, { name: "configuration.supportedLocales", label: "Supported Locales", type: "select", placeholder: "Select locales", multiple: !0, options: Hr }, { name: "configuration.defaultCurrency", label: "Currency", type: "select", placeholder: "Acme Inc.", options: Kl }], tu = ({ onClose: a, initialData: t }) => {
|
|
2329
2329
|
var o, d, u;
|
|
2330
|
-
const { client: r } = I(), n = me({ resolver: ue(
|
|
2330
|
+
const { client: r } = I(), n = me({ resolver: ue(dr), defaultValues: { configuration: { defaultLocale: (o = t == null ? void 0 : t.configuration) == null ? void 0 : o.defaultLocale, supportedLocales: (d = t == null ? void 0 : t.configuration) == null ? void 0 : d.supportedLocales, defaultCurrency: (u = t == null ? void 0 : t.configuration) == null ? void 0 : u.defaultCurrency } } }), { isPending: s, mutate: l } = L({ mutationFn: async ({ configuration: c }) => {
|
|
2331
2331
|
const { status: h } = await r.organization.updateOrganization({ params: { organizationId: t == null ? void 0 : t.id }, body: { configuration: c } });
|
|
2332
2332
|
if (h !== 200) throw O.error("Failed to update organization. Please try again later."), new Error("Failed to update organization");
|
|
2333
2333
|
return await se.invalidateQueries({ queryKey: ["organizations"] }), a && a();
|
|
2334
2334
|
} });
|
|
2335
|
-
return e(ze, { form: n, config:
|
|
2335
|
+
return e(ze, { form: n, config: au, onSubmit: (c) => l(c), onCancel: a, loading: s, cancelText: "Go back", okText: "Save Settings" });
|
|
2336
2336
|
};
|
|
2337
|
-
function
|
|
2337
|
+
function ru() {
|
|
2338
2338
|
const { organization: a } = be(), { client: t } = I(), r = U(), n = _(), s = K(), l = L({ mutationFn: async () => {
|
|
2339
2339
|
const { status: o } = await t.access.leaveOrganization({ params: { organizationId: r } });
|
|
2340
2340
|
if (o !== 204) throw new Error("Failed to leave organization");
|
|
@@ -2343,12 +2343,12 @@ function tu() {
|
|
|
2343
2343
|
}, onError: (o) => {
|
|
2344
2344
|
O.error((o == null ? void 0 : o.message) || "Failed to leave organization");
|
|
2345
2345
|
} });
|
|
2346
|
-
return a.data ? i("div", { className: "space-y-10", children: [e("section", { "aria-labelledby": "org-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "org-information", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Organization Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Manage your organization information." })] }), e("div", { className: "md:col-span-2", children: e(
|
|
2346
|
+
return a.data ? i("div", { className: "space-y-10", children: [e("section", { "aria-labelledby": "org-information", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "org-information", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Organization Information" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Manage your organization information." })] }), e("div", { className: "md:col-span-2", children: e(ds, { initialData: a.data }) })] }) }), e(W, {}), e("section", { "aria-labelledby": "locale-settings", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "locale-settings", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Currency and Locale" }), e("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: "Set the currency and languages you support" })] }), e("div", { className: "md:col-span-2", children: e(tu, { initialData: a.data }) })] }) }), e(W, {}), e("section", { "aria-labelledby": "danger-zone", children: i("div", { className: "grid grid-cols-1 gap-x-14 gap-y-8 md:grid-cols-3", children: [i("div", { children: [e("h2", { id: "danger-zone", className: "scroll-mt-10 font-semibold text-gray-900 dark:text-gray-50", children: "Danger zone" }), i("p", { className: "mt-1 text-sm leading-6 text-gray-500", children: ["Manage general workspace. Contact system admin for more information.", " ", i("a", { href: "#", className: "inline-flex items-center gap-1 text-indigo-600 hover:underline hover:underline-offset-4 dark:text-indigo-400", children: ["Learn more", e(Vs, { className: "size-4 shrink-0", "aria-hidden": "true" })] })] })] }), e("div", { className: "space-y-6 md:col-span-2", children: e(ya, { className: "p-4", children: i("div", { className: "flex items-start justify-between gap-10", children: [i("div", { children: [e("h4", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: "Leave workspace" }), e("p", { className: "mt-2 text-sm leading-6 text-gray-500", children: "Revoke your access to this team. Other people you have added to the workspace will remain." })] }), e(z, { variant: "secondary", className: "text-red-600 dark:text-red-500", onClick: () => l.mutate(), isLoading: l.isPending, loadingText: "Leaving...", children: "Leave" })] }) }) })] }) })] }) : e("div", { children: "Loading..." });
|
|
2347
2347
|
}
|
|
2348
2348
|
function re(a, t) {
|
|
2349
2349
|
return { label: "Home", href: t.dashboard(a) };
|
|
2350
2350
|
}
|
|
2351
|
-
function
|
|
2351
|
+
function iu(a, t) {
|
|
2352
2352
|
switch (a.type) {
|
|
2353
2353
|
case "home":
|
|
2354
2354
|
case "sign-in":
|
|
@@ -2398,40 +2398,40 @@ function ru(a, t) {
|
|
|
2398
2398
|
return [re(a.orgId, t), { label: "Settings", href: t.settings(a.orgId) }, { label: "Access", href: t.settingsAccess(a.orgId) }, { label: "Edit Member" }];
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2402
|
-
const t = K(), r =
|
|
2401
|
+
function nu({ view: a }) {
|
|
2402
|
+
const t = K(), r = iu(a, t);
|
|
2403
2403
|
return r.length === 0 ? null : e("nav", { "aria-label": "Breadcrumb", className: "mb-4 overflow-x-auto pb-1", children: e("ol", { className: "flex min-w-max items-center text-sm text-gray-500 dark:text-gray-400", children: r.map((n, s) => {
|
|
2404
2404
|
const l = s === r.length - 1;
|
|
2405
|
-
return i("li", { className: "flex items-center", children: [s > 0 ? e(
|
|
2405
|
+
return i("li", { className: "flex items-center", children: [s > 0 ? e(Zs, { className: "mx-1 size-3.5 shrink-0 text-gray-400 dark:text-gray-500", "aria-hidden": "true" }) : null, n.href && !l ? e(E, { href: n.href, className: "whitespace-nowrap rounded-sm transition hover:text-gray-900 dark:hover:text-gray-200", children: n.label }) : e("span", { "aria-current": l ? "page" : void 0, className: l ? "whitespace-nowrap font-medium text-gray-900 dark:text-gray-50" : "whitespace-nowrap", children: n.label })] }, `${n.label}-${s}`);
|
|
2406
2406
|
}) }) });
|
|
2407
2407
|
}
|
|
2408
|
-
const nu = () => i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 451, zoomAndPan: "magnify", viewBox: "0 0 338.25 101.249998", height: 135, preserveAspectRatio: "xMidYMid meet", className: "h-auto w-3/4 mr-5 text-[#15203a] dark:text-white", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "e96f145012", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("g", {}), e("clipPath", { id: "2854c0f5ba", children: e("path", { d: "M 280.070312 29.789062 L 335.910156 29.789062 L 335.910156 85.628906 L 280.070312 85.628906 Z M 280.070312 29.789062 ", clipRule: "nonzero" }) }), e("clipPath", { id: "a2b4eafd05", children: e("path", { d: "M 312.023438 83.421875 L 333.382812 62.0625 C 335.910156 59.535156 335.910156 55.460938 333.382812 52.933594 L 312.285156 31.835938 C 310.859375 30.410156 308.949219 29.632812 306.941406 29.632812 L 280.46875 29.632812 L 303.773438 52.933594 C 306.296875 55.460938 306.296875 59.535156 303.773438 62.0625 L 280.210938 85.621094 L 306.683594 85.621094 C 308.691406 85.621094 310.601562 84.8125 312.023438 83.421875 Z M 312.023438 83.421875 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", id: "c594f9d06d", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "1f1a4971c6", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "d584d4a10b", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "ca59399d09", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 279.805145, 86.320587)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#d584d4a10b)", children: e("g", { mask: "url(#1f1a4971c6)", children: e("rect", { x: "-356.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-37.48", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "058149a1c1", children: e("path", { d: "M 271.277344 20.996094 L 327 20.996094 L 327 76.832031 L 271.277344 76.832031 Z M 271.277344 20.996094 ", clipRule: "nonzero" }) }), e("clipPath", { id: "3a8b0dae6b", children: e("path", { d: "M 303.230469 74.625 L 324.589844 53.265625 C 327.113281 50.742188 327.113281 46.664062 324.589844 44.140625 L 303.488281 23.039062 C 302.0625 21.613281 300.15625 20.839844 298.148438 20.839844 L 271.675781 20.839844 L 294.976562 44.140625 C 297.5 46.664062 297.5 50.742188 294.976562 53.265625 L 271.414062 76.824219 L 297.890625 76.824219 C 299.894531 76.824219 301.804688 76.015625 303.230469 74.625 Z M 303.230469 74.625 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", id: "85d98eb3ed", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "712d9ec0cc", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "66291c0f48", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "82194e6edc", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 270.871322, 77.386763)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#66291c0f48)", children: e("g", { mask: "url(#712d9ec0cc)", children: e("rect", { x: "-347.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-46.48", fillOpacity: 1 }) }) }) }) })] }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(19.705917, 70.793676)", children: e("g", { children: e("path", { d: "M 16.359375 0.0625 C 13.921875 0.0625 11.773438 -0.289062 9.921875 -1 C 8.441406 -1.59375 6.925781 -2.570312 5.375 -3.9375 C 3.601562 -5.5625 2.476562 -7.578125 2 -9.984375 C 1.8125 -10.753906 1.71875 -11.53125 1.71875 -12.3125 C 1.675781 -12.570312 1.675781 -12.832031 1.71875 -13.09375 L 1.71875 -13.46875 L 9.3125 -13.359375 L 9.3125 -13.421875 C 9.3125 -12.054688 9.609375 -10.925781 10.203125 -10.03125 C 11.304688 -8.375 13.359375 -7.546875 16.359375 -7.546875 C 21.160156 -7.546875 23.5625 -8.671875 23.5625 -10.921875 C 23.5625 -13.109375 21.085938 -14.476562 16.140625 -15.03125 C 13.285156 -15.363281 10.84375 -15.953125 8.8125 -16.796875 C 6.925781 -17.578125 5.394531 -18.613281 4.21875 -19.90625 C 2.550781 -21.757812 1.71875 -23.90625 1.71875 -26.34375 C 1.71875 -27.851562 1.992188 -29.273438 2.546875 -30.609375 C 2.953125 -31.609375 3.507812 -32.515625 4.21875 -33.328125 C 6.800781 -36.242188 10.90625 -37.703125 16.53125 -37.703125 C 19.894531 -37.703125 22.738281 -37.039062 25.0625 -35.71875 C 26.832031 -34.71875 28.273438 -33.382812 29.390625 -31.71875 C 30.203125 -30.457031 30.773438 -29.015625 31.109375 -27.390625 C 31.222656 -26.835938 31.296875 -26.285156 31.328125 -25.734375 C 31.367188 -25.546875 31.390625 -25.359375 31.390625 -25.171875 L 31.390625 -24.84375 L 23.796875 -24.84375 L 23.796875 -24.78125 C 23.828125 -25.894531 23.546875 -26.835938 22.953125 -27.609375 C 21.773438 -29.273438 19.632812 -30.109375 16.53125 -30.109375 C 14.644531 -30.109375 13.085938 -29.867188 11.859375 -29.390625 C 10.347656 -28.796875 9.59375 -27.945312 9.59375 -26.84375 C 9.59375 -24.550781 12.050781 -23.125 16.96875 -22.5625 C 22.507812 -21.9375 26.503906 -20.21875 28.953125 -17.40625 C 30.578125 -15.488281 31.390625 -13.328125 31.390625 -10.921875 L 31.390625 -10.421875 C 31.390625 -10.203125 31.367188 -9.984375 31.328125 -9.765625 C 31.296875 -9.171875 31.222656 -8.613281 31.109375 -8.09375 C 30.734375 -6.613281 30.03125 -5.300781 29 -4.15625 C 27.78125 -2.789062 26.132812 -1.738281 24.0625 -1 C 22 -0.289062 19.429688 0.0625 16.359375 0.0625 Z M 16.359375 0.0625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(52.748732, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(85.181699, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(114.89805, 70.793676)", children: e("g", { children: e("path", { d: "M 16.53125 -28.5625 C 20.445312 -28.59375 23.8125 -27.222656 26.625 -24.453125 C 29.425781 -21.679688 30.847656 -18.316406 30.890625 -14.359375 C 30.921875 -10.441406 29.550781 -7.078125 26.78125 -4.265625 C 24.007812 -1.460938 20.644531 -0.0390625 16.6875 0 C 13.46875 0 11.046875 -1.015625 9.421875 -3.046875 L 9.421875 10.640625 L 1.65625 10.640625 L 1.65625 -28.5 L 9.421875 -28.5 L 9.421875 -25.515625 C 10.941406 -27.472656 13.3125 -28.488281 16.53125 -28.5625 Z M 21.625 -9.3125 C 23.03125 -10.71875 23.695312 -12.382812 23.625 -14.3125 C 23.625 -16.269531 22.941406 -17.929688 21.578125 -19.296875 C 20.171875 -20.628906 18.503906 -21.296875 16.578125 -21.296875 C 14.617188 -21.296875 12.957031 -20.613281 11.59375 -19.25 C 10.21875 -17.800781 9.53125 -16.132812 9.53125 -14.25 C 9.613281 -12.25 10.316406 -10.585938 11.640625 -9.265625 C 13.015625 -7.890625 14.679688 -7.203125 16.640625 -7.203125 C 18.628906 -7.273438 20.289062 -7.976562 21.625 -9.3125 Z M 21.625 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(146.665722, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(179.09869, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(208.81504, 70.793676)", children: e("g", { children: e("path", { d: "M 13.203125 0 C 11.273438 0 9.59375 -0.296875 8.15625 -0.890625 C 7.007812 -1.296875 5.828125 -2.050781 4.609375 -3.15625 C 2.492188 -5.113281 1.53125 -7.59375 1.71875 -10.59375 L 1.71875 -11.203125 L 7.9375 -11.09375 L 8.421875 -11.09375 L 8.421875 -10.640625 C 8.460938 -9.722656 8.664062 -8.96875 9.03125 -8.375 C 9.664062 -7.300781 11.054688 -6.765625 13.203125 -6.765625 C 14.972656 -6.765625 16.25 -6.96875 17.03125 -7.375 C 17.4375 -7.5625 17.710938 -7.800781 17.859375 -8.09375 C 17.929688 -8.207031 17.96875 -8.316406 17.96875 -8.421875 L 18.015625 -8.703125 C 18.015625 -9.484375 17.40625 -10.113281 16.1875 -10.59375 C 15.707031 -10.78125 15.15625 -10.925781 14.53125 -11.03125 C 14.050781 -11.144531 13.515625 -11.238281 12.921875 -11.3125 C 10.703125 -11.53125 8.851562 -11.972656 7.375 -12.640625 C 5.894531 -13.234375 4.675781 -14.046875 3.71875 -15.078125 C 2.382812 -16.597656 1.71875 -18.335938 1.71875 -20.296875 C 1.71875 -21.515625 1.941406 -22.640625 2.390625 -23.671875 C 2.722656 -24.484375 3.164062 -25.207031 3.71875 -25.84375 C 5.707031 -28.132812 8.90625 -29.28125 13.3125 -29.28125 C 15.9375 -29.28125 18.15625 -28.757812 19.96875 -27.71875 C 21.375 -26.945312 22.5 -25.894531 23.34375 -24.5625 C 24.007812 -23.5625 24.472656 -22.398438 24.734375 -21.078125 C 24.804688 -20.628906 24.859375 -20.203125 24.890625 -19.796875 L 24.890625 -18.625 L 18.1875 -18.625 L 18.1875 -19.46875 C 18.15625 -19.613281 18.140625 -19.757812 18.140625 -19.90625 C 18.023438 -20.3125 17.875 -20.644531 17.6875 -20.90625 C 16.875 -22.007812 15.414062 -22.5625 13.3125 -22.5625 C 10.207031 -22.5625 8.65625 -21.914062 8.65625 -20.625 C 8.65625 -19.957031 9.023438 -19.421875 9.765625 -19.015625 C 10.535156 -18.535156 11.847656 -18.1875 13.703125 -17.96875 C 17.953125 -17.519531 21.035156 -16.171875 22.953125 -13.921875 C 24.242188 -12.398438 24.890625 -10.660156 24.890625 -8.703125 L 24.890625 -8.3125 L 24.84375 -7.8125 C 24.84375 -7.332031 24.785156 -6.890625 24.671875 -6.484375 C 24.378906 -5.304688 23.828125 -4.253906 23.015625 -3.328125 C 22.085938 -2.210938 20.789062 -1.378906 19.125 -0.828125 C 17.46875 -0.273438 15.492188 0 13.203125 0 Z M 13.203125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(235.371259, 70.793676)", children: e("g", { children: e("path", { d: "M 22.234375 -28.5625 L 22.234375 -20.796875 L 15.859375 -20.796875 L 15.859375 0 L 8.09375 0 L 8.09375 -20.796875 L 1.65625 -20.796875 L 1.65625 -28.5625 L 8.09375 -28.5625 L 8.09375 -38.546875 L 15.859375 -38.546875 L 15.859375 -28.5625 Z M 22.234375 -28.5625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(259.266309, 70.793676)", children: e("g", { children: e("path", { d: "M 9.421875 0 L 1.65625 0 L 1.65625 -7.765625 L 9.421875 -7.765625 Z M 9.421875 0 " }) }) }) }), e("g", { clipPath: "url(#2854c0f5ba)", children: e("g", { clipPath: "url(#a2b4eafd05)", children: e("path", { fill: "url(#ca59399d09)", d: "M 335.910156 85.621094 L 280.214844 85.621094 L 280.214844 29.789062 L 335.910156 29.789062 Z M 335.910156 85.621094 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#058149a1c1)", children: e("g", { clipPath: "url(#3a8b0dae6b)", children: e("path", { fill: "url(#82194e6edc)", d: "M 327.113281 76.824219 L 271.417969 76.824219 L 271.417969 20.992188 L 327.113281 20.992188 Z M 327.113281 76.824219 ", fillRule: "nonzero" }) }) })] }), ys = (a) => e($.Root, { ...a });
|
|
2409
|
-
|
|
2410
|
-
const
|
|
2411
|
-
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2414
|
-
const
|
|
2415
|
-
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
const
|
|
2419
|
-
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2422
|
-
const
|
|
2423
|
-
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
function
|
|
2408
|
+
const su = () => i("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", width: 451, zoomAndPan: "magnify", viewBox: "0 0 338.25 101.249998", height: 135, preserveAspectRatio: "xMidYMid meet", className: "h-auto w-3/4 mr-5 text-[#15203a] dark:text-white", children: [i("defs", { children: [e("filter", { x: "0%", y: "0%", width: "100%", height: "100%", id: "e96f145012", children: e("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0", colorInterpolationFilters: "sRGB" }) }), e("g", {}), e("clipPath", { id: "2854c0f5ba", children: e("path", { d: "M 280.070312 29.789062 L 335.910156 29.789062 L 335.910156 85.628906 L 280.070312 85.628906 Z M 280.070312 29.789062 ", clipRule: "nonzero" }) }), e("clipPath", { id: "a2b4eafd05", children: e("path", { d: "M 312.023438 83.421875 L 333.382812 62.0625 C 335.910156 59.535156 335.910156 55.460938 333.382812 52.933594 L 312.285156 31.835938 C 310.859375 30.410156 308.949219 29.632812 306.941406 29.632812 L 280.46875 29.632812 L 303.773438 52.933594 C 306.296875 55.460938 306.296875 59.535156 303.773438 62.0625 L 280.210938 85.621094 L 306.683594 85.621094 C 308.691406 85.621094 310.601562 84.8125 312.023438 83.421875 Z M 312.023438 83.421875 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", id: "c594f9d06d", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "1f1a4971c6", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAdElEQVRoge3PMQqEQBAAwXVB//9kEwMD9eAwKrthYGBgoJZx3xxjrMdsp/1qft3f+PHvfc4HJFNIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFIppFJIpZBKIZU+gdwB24gBccg7AIAAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "d584d4a10b", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "ca59399d09", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 279.805145, 86.320587)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#d584d4a10b)", children: e("g", { mask: "url(#1f1a4971c6)", children: e("rect", { x: "-356.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-37.48", fillOpacity: 1 }) }) }) }) }), e("clipPath", { id: "058149a1c1", children: e("path", { d: "M 271.277344 20.996094 L 327 20.996094 L 327 76.832031 L 271.277344 76.832031 Z M 271.277344 20.996094 ", clipRule: "nonzero" }) }), e("clipPath", { id: "3a8b0dae6b", children: e("path", { d: "M 303.230469 74.625 L 324.589844 53.265625 C 327.113281 50.742188 327.113281 46.664062 324.589844 44.140625 L 303.488281 23.039062 C 302.0625 21.613281 300.15625 20.839844 298.148438 20.839844 L 271.675781 20.839844 L 294.976562 44.140625 C 297.5 46.664062 297.5 50.742188 294.976562 53.265625 L 271.414062 76.824219 L 297.890625 76.824219 C 299.894531 76.824219 301.804688 76.015625 303.230469 74.625 Z M 303.230469 74.625 ", clipRule: "nonzero" }) }), e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", id: "85d98eb3ed", height: 57, preserveAspectRatio: "xMidYMid meet" }), e("mask", { id: "712d9ec0cc", children: e("g", { filter: "url(#e96f145012)", children: e("g", { children: e("image", { x: 0, y: 0, width: 57, xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADkAAAA5CAYAAACMGIOFAAAABmJLR0QA/wD/AP+gvaeTAAAAbklEQVRoge3PwQmAAAwEwaho/yVbgfrQ17gLeR0EZpnrlpk5Zma/ubf7Fz+e9m29QTKFVAqpFFIppFJIpZBKIZVCKoVUCqkUUimkUkilkEohlUIqhVQKqRRSKaRSSKWQSiGVQiqFVAqpFFLpF8gT2vQBcSod/NEAAAAASUVORK5CYII=", height: 57, preserveAspectRatio: "xMidYMid meet" }) }) }) }), e("clipPath", { id: "66291c0f48", children: e("rect", { x: 0, width: 57, y: 0, height: 57 }) }), e("pattern", { id: "82194e6edc", patternUnits: "userSpaceOnUse", width: 57, patternTransform: "matrix(0.992647, 0, 0, -0.992647, 270.871322, 77.386763)", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 57 57", height: 57, x: 0, y: 0, children: e("g", { children: e("g", { clipPath: "url(#66291c0f48)", children: e("g", { mask: "url(#712d9ec0cc)", children: e("rect", { x: "-347.844005", width: "490.68801", fill: "#8c52ff", height: "146.88", y: "-46.48", fillOpacity: 1 }) }) }) }) })] }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(19.705917, 70.793676)", children: e("g", { children: e("path", { d: "M 16.359375 0.0625 C 13.921875 0.0625 11.773438 -0.289062 9.921875 -1 C 8.441406 -1.59375 6.925781 -2.570312 5.375 -3.9375 C 3.601562 -5.5625 2.476562 -7.578125 2 -9.984375 C 1.8125 -10.753906 1.71875 -11.53125 1.71875 -12.3125 C 1.675781 -12.570312 1.675781 -12.832031 1.71875 -13.09375 L 1.71875 -13.46875 L 9.3125 -13.359375 L 9.3125 -13.421875 C 9.3125 -12.054688 9.609375 -10.925781 10.203125 -10.03125 C 11.304688 -8.375 13.359375 -7.546875 16.359375 -7.546875 C 21.160156 -7.546875 23.5625 -8.671875 23.5625 -10.921875 C 23.5625 -13.109375 21.085938 -14.476562 16.140625 -15.03125 C 13.285156 -15.363281 10.84375 -15.953125 8.8125 -16.796875 C 6.925781 -17.578125 5.394531 -18.613281 4.21875 -19.90625 C 2.550781 -21.757812 1.71875 -23.90625 1.71875 -26.34375 C 1.71875 -27.851562 1.992188 -29.273438 2.546875 -30.609375 C 2.953125 -31.609375 3.507812 -32.515625 4.21875 -33.328125 C 6.800781 -36.242188 10.90625 -37.703125 16.53125 -37.703125 C 19.894531 -37.703125 22.738281 -37.039062 25.0625 -35.71875 C 26.832031 -34.71875 28.273438 -33.382812 29.390625 -31.71875 C 30.203125 -30.457031 30.773438 -29.015625 31.109375 -27.390625 C 31.222656 -26.835938 31.296875 -26.285156 31.328125 -25.734375 C 31.367188 -25.546875 31.390625 -25.359375 31.390625 -25.171875 L 31.390625 -24.84375 L 23.796875 -24.84375 L 23.796875 -24.78125 C 23.828125 -25.894531 23.546875 -26.835938 22.953125 -27.609375 C 21.773438 -29.273438 19.632812 -30.109375 16.53125 -30.109375 C 14.644531 -30.109375 13.085938 -29.867188 11.859375 -29.390625 C 10.347656 -28.796875 9.59375 -27.945312 9.59375 -26.84375 C 9.59375 -24.550781 12.050781 -23.125 16.96875 -22.5625 C 22.507812 -21.9375 26.503906 -20.21875 28.953125 -17.40625 C 30.578125 -15.488281 31.390625 -13.328125 31.390625 -10.921875 L 31.390625 -10.421875 C 31.390625 -10.203125 31.367188 -9.984375 31.328125 -9.765625 C 31.296875 -9.171875 31.222656 -8.613281 31.109375 -8.09375 C 30.734375 -6.613281 30.03125 -5.300781 29 -4.15625 C 27.78125 -2.789062 26.132812 -1.738281 24.0625 -1 C 22 -0.289062 19.429688 0.0625 16.359375 0.0625 Z M 16.359375 0.0625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(52.748732, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(85.181699, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(114.89805, 70.793676)", children: e("g", { children: e("path", { d: "M 16.53125 -28.5625 C 20.445312 -28.59375 23.8125 -27.222656 26.625 -24.453125 C 29.425781 -21.679688 30.847656 -18.316406 30.890625 -14.359375 C 30.921875 -10.441406 29.550781 -7.078125 26.78125 -4.265625 C 24.007812 -1.460938 20.644531 -0.0390625 16.6875 0 C 13.46875 0 11.046875 -1.015625 9.421875 -3.046875 L 9.421875 10.640625 L 1.65625 10.640625 L 1.65625 -28.5 L 9.421875 -28.5 L 9.421875 -25.515625 C 10.941406 -27.472656 13.3125 -28.488281 16.53125 -28.5625 Z M 21.625 -9.3125 C 23.03125 -10.71875 23.695312 -12.382812 23.625 -14.3125 C 23.625 -16.269531 22.941406 -17.929688 21.578125 -19.296875 C 20.171875 -20.628906 18.503906 -21.296875 16.578125 -21.296875 C 14.617188 -21.296875 12.957031 -20.613281 11.59375 -19.25 C 10.21875 -17.800781 9.53125 -16.132812 9.53125 -14.25 C 9.613281 -12.25 10.316406 -10.585938 11.640625 -9.265625 C 13.015625 -7.890625 14.679688 -7.203125 16.640625 -7.203125 C 18.628906 -7.273438 20.289062 -7.976562 21.625 -9.3125 Z M 21.625 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(146.665722, 70.793676)", children: e("g", { children: e("path", { d: "M 30.78125 0 L 23.5625 0 L 23.5625 -14.078125 L 23.515625 -14.078125 L 23.515625 -14.25 C 23.515625 -16.175781 22.828125 -17.820312 21.453125 -19.1875 C 20.085938 -20.550781 18.425781 -21.234375 16.46875 -21.234375 C 14.550781 -21.234375 12.890625 -20.53125 11.484375 -19.125 C 10.078125 -17.726562 9.410156 -16.066406 9.484375 -14.140625 L 9.484375 -14.078125 L 9.421875 -14.078125 L 9.421875 0 L 1.65625 0 L 1.65625 -36.046875 L 9.421875 -36.046875 L 9.421875 -24.953125 C 11.160156 -27.023438 13.492188 -28.191406 16.421875 -28.453125 C 20.484375 -28.785156 23.84375 -27.726562 26.5 -25.28125 C 29.351562 -22.65625 30.78125 -18.976562 30.78125 -14.25 Z M 30.78125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(179.09869, 70.793676)", children: e("g", { children: e("path", { d: "M 14.8125 -28.5625 C 18.757812 -28.59375 22.117188 -27.222656 24.890625 -24.453125 C 27.703125 -21.640625 29.109375 -18.273438 29.109375 -14.359375 C 29.148438 -10.398438 27.785156 -7.035156 25.015625 -4.265625 C 22.234375 -1.460938 18.882812 -0.0390625 14.96875 0 C 11.007812 0.0390625 7.628906 -1.328125 4.828125 -4.109375 C 2.015625 -6.878906 0.609375 -10.242188 0.609375 -14.203125 C 0.566406 -18.148438 1.9375 -21.507812 4.71875 -24.28125 C 7.488281 -27.09375 10.851562 -28.519531 14.8125 -28.5625 Z M 19.859375 -9.3125 C 21.222656 -10.6875 21.90625 -12.351562 21.90625 -14.3125 C 21.90625 -16.226562 21.203125 -17.890625 19.796875 -19.296875 C 18.390625 -20.628906 16.726562 -21.296875 14.8125 -21.296875 C 12.882812 -21.296875 11.238281 -20.613281 9.875 -19.25 C 8.5 -17.800781 7.8125 -16.132812 7.8125 -14.25 C 7.8125 -12.332031 8.515625 -10.671875 9.921875 -9.265625 C 11.296875 -7.890625 12.960938 -7.203125 14.921875 -7.203125 C 16.910156 -7.273438 18.554688 -7.976562 19.859375 -9.3125 Z M 19.859375 -9.3125 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(208.81504, 70.793676)", children: e("g", { children: e("path", { d: "M 13.203125 0 C 11.273438 0 9.59375 -0.296875 8.15625 -0.890625 C 7.007812 -1.296875 5.828125 -2.050781 4.609375 -3.15625 C 2.492188 -5.113281 1.53125 -7.59375 1.71875 -10.59375 L 1.71875 -11.203125 L 7.9375 -11.09375 L 8.421875 -11.09375 L 8.421875 -10.640625 C 8.460938 -9.722656 8.664062 -8.96875 9.03125 -8.375 C 9.664062 -7.300781 11.054688 -6.765625 13.203125 -6.765625 C 14.972656 -6.765625 16.25 -6.96875 17.03125 -7.375 C 17.4375 -7.5625 17.710938 -7.800781 17.859375 -8.09375 C 17.929688 -8.207031 17.96875 -8.316406 17.96875 -8.421875 L 18.015625 -8.703125 C 18.015625 -9.484375 17.40625 -10.113281 16.1875 -10.59375 C 15.707031 -10.78125 15.15625 -10.925781 14.53125 -11.03125 C 14.050781 -11.144531 13.515625 -11.238281 12.921875 -11.3125 C 10.703125 -11.53125 8.851562 -11.972656 7.375 -12.640625 C 5.894531 -13.234375 4.675781 -14.046875 3.71875 -15.078125 C 2.382812 -16.597656 1.71875 -18.335938 1.71875 -20.296875 C 1.71875 -21.515625 1.941406 -22.640625 2.390625 -23.671875 C 2.722656 -24.484375 3.164062 -25.207031 3.71875 -25.84375 C 5.707031 -28.132812 8.90625 -29.28125 13.3125 -29.28125 C 15.9375 -29.28125 18.15625 -28.757812 19.96875 -27.71875 C 21.375 -26.945312 22.5 -25.894531 23.34375 -24.5625 C 24.007812 -23.5625 24.472656 -22.398438 24.734375 -21.078125 C 24.804688 -20.628906 24.859375 -20.203125 24.890625 -19.796875 L 24.890625 -18.625 L 18.1875 -18.625 L 18.1875 -19.46875 C 18.15625 -19.613281 18.140625 -19.757812 18.140625 -19.90625 C 18.023438 -20.3125 17.875 -20.644531 17.6875 -20.90625 C 16.875 -22.007812 15.414062 -22.5625 13.3125 -22.5625 C 10.207031 -22.5625 8.65625 -21.914062 8.65625 -20.625 C 8.65625 -19.957031 9.023438 -19.421875 9.765625 -19.015625 C 10.535156 -18.535156 11.847656 -18.1875 13.703125 -17.96875 C 17.953125 -17.519531 21.035156 -16.171875 22.953125 -13.921875 C 24.242188 -12.398438 24.890625 -10.660156 24.890625 -8.703125 L 24.890625 -8.3125 L 24.84375 -7.8125 C 24.84375 -7.332031 24.785156 -6.890625 24.671875 -6.484375 C 24.378906 -5.304688 23.828125 -4.253906 23.015625 -3.328125 C 22.085938 -2.210938 20.789062 -1.378906 19.125 -0.828125 C 17.46875 -0.273438 15.492188 0 13.203125 0 Z M 13.203125 0 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(235.371259, 70.793676)", children: e("g", { children: e("path", { d: "M 22.234375 -28.5625 L 22.234375 -20.796875 L 15.859375 -20.796875 L 15.859375 0 L 8.09375 0 L 8.09375 -20.796875 L 1.65625 -20.796875 L 1.65625 -28.5625 L 8.09375 -28.5625 L 8.09375 -38.546875 L 15.859375 -38.546875 L 15.859375 -28.5625 Z M 22.234375 -28.5625 " }) }) }) }), e("g", { fill: "currentColor", fillOpacity: 1, children: e("g", { transform: "translate(259.266309, 70.793676)", children: e("g", { children: e("path", { d: "M 9.421875 0 L 1.65625 0 L 1.65625 -7.765625 L 9.421875 -7.765625 Z M 9.421875 0 " }) }) }) }), e("g", { clipPath: "url(#2854c0f5ba)", children: e("g", { clipPath: "url(#a2b4eafd05)", children: e("path", { fill: "url(#ca59399d09)", d: "M 335.910156 85.621094 L 280.214844 85.621094 L 280.214844 29.789062 L 335.910156 29.789062 Z M 335.910156 85.621094 ", fillRule: "nonzero" }) }) }), e("g", { clipPath: "url(#058149a1c1)", children: e("g", { clipPath: "url(#3a8b0dae6b)", children: e("path", { fill: "url(#82194e6edc)", d: "M 327.113281 76.824219 L 271.417969 76.824219 L 271.417969 20.992188 L 327.113281 20.992188 Z M 327.113281 76.824219 ", fillRule: "nonzero" }) }) })] }), fs = (a) => e($.Root, { ...a });
|
|
2409
|
+
fs.displayName = "Drawer";
|
|
2410
|
+
const ys = A.forwardRef(({ className: a, ...t }, r) => e($.Trigger, { ref: r, className: x(a), ...t }));
|
|
2411
|
+
ys.displayName = "Drawer.Trigger";
|
|
2412
|
+
const bs = A.forwardRef(({ className: a, ...t }, r) => e($.Close, { ref: r, className: x(a), ...t }));
|
|
2413
|
+
bs.displayName = "Drawer.Close";
|
|
2414
|
+
const xs = $.Portal;
|
|
2415
|
+
xs.displayName = "DrawerPortal";
|
|
2416
|
+
const ws = A.forwardRef(({ className: a, ...t }, r) => e($.Overlay, { ref: r, className: x("fixed inset-0 z-50 overflow-y-auto", "bg-black/30", "data-[state=closed]:animate-hide data-[state=open]:animate-dialogOverlayShow", a), ...t, style: { animationDuration: "400ms", animationFillMode: "backwards" } }));
|
|
2417
|
+
ws.displayName = "DrawerOverlay";
|
|
2418
|
+
const ks = A.forwardRef(({ className: a, ...t }, r) => e(xs, { children: e(ws, { children: e($.Content, { ref: r, className: x("fixed inset-y-2 mx-auto flex w-[95vw] flex-1 flex-col overflow-y-auto rounded-md border p-4 shadow-lg focus:outline-hidden max-sm:inset-x-2 sm:inset-y-2 sm:right-2 sm:max-w-lg sm:p-6", "border-gray-200 dark:border-gray-900", "bg-white dark:bg-[#090E1A]", "data-[state=closed]:animate-drawerSlideRightAndFade data-[state=open]:animate-drawerSlideLeftAndFade", ye, a), ...t }) }) }));
|
|
2419
|
+
ks.displayName = "DrawerContent";
|
|
2420
|
+
const vs = A.forwardRef(({ children: a, className: t, ...r }, n) => i("div", { ref: n, className: "flex items-start justify-between gap-x-4 border-b border-gray-200 pb-4 dark:border-gray-900", ...r, children: [e("div", { className: x("mt-1 flex flex-col gap-y-1", t), children: a }), e($.Close, { asChild: !0, children: e(z, { variant: "ghost", className: "aspect-square p-1 hover:bg-gray-100 dark:hover:bg-gray-400/10", children: e(Fi, { className: "size-6", "aria-hidden": "true" }) }) })] }));
|
|
2421
|
+
vs.displayName = "Drawer.Header";
|
|
2422
|
+
const Ns = A.forwardRef(({ className: a, ...t }, r) => e($.Title, { ref: r, className: x("text-base font-semibold", "text-gray-900 dark:text-gray-50", a), ...t }));
|
|
2423
|
+
Ns.displayName = "DrawerTitle";
|
|
2424
|
+
const As = A.forwardRef(({ className: a, ...t }, r) => e("div", { ref: r, className: x("flex-1 py-4", a), ...t }));
|
|
2425
|
+
As.displayName = "Drawer.Body";
|
|
2426
|
+
const lu = A.forwardRef(({ className: a, ...t }, r) => e($.Description, { ref: r, className: x("text-gray-500 dark:text-gray-500", a), ...t }));
|
|
2427
|
+
lu.displayName = "DrawerDescription";
|
|
2428
|
+
function ou() {
|
|
2429
2429
|
const a = We(), t = U(), r = K();
|
|
2430
2430
|
if (!t) return null;
|
|
2431
2431
|
const n = [{ name: "Dashboard", href: r.dashboard(t), icon: vi }, { name: "Live Orders", href: r.liveOrders(t), icon: Ni }, { name: "Orders", href: r.orders(t), icon: Ai }, { name: "Reservations", href: r.reservations(t), icon: Ci }, { name: "Products", href: r.products(t), icon: Si }, { name: "Categories", href: r.productCategories(t), icon: Ii }, { name: "Manufacturers", href: r.manufacturers(t), icon: Ei }, { name: "Settings", href: r.settings(t), icon: Oi }];
|
|
2432
|
-
return i(
|
|
2432
|
+
return i(fs, { children: [e(ys, { asChild: !0, children: e(z, { variant: "ghost", "aria-label": "open sidebar", className: "group flex items-center rounded-md p-2 text-sm font-medium hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10", children: e(rl, { className: "size-6 shrink-0 sm:size-5", "aria-hidden": "true" }) }) }), i(ks, { className: "sm:max-w-lg", children: [e(vs, { children: e(Ns, { children: "Navigation" }) }), e(As, { children: e("nav", { "aria-label": "mobile navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-1.5", children: n.map((s) => e("li", { children: e(bs, { asChild: !0, children: i(E, { href: s.href, className: X(a === s.href || a != null && a.startsWith(s.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-base font-medium transition hover:bg-gray-100 sm:text-sm dark:hover:bg-gray-900", ye), children: [e(s.icon, { className: "size-5 shrink-0", "aria-hidden": "true" }), s.name] }) }) }, s.name)) }) }) })] })] });
|
|
2433
2433
|
}
|
|
2434
|
-
const
|
|
2434
|
+
const du = () => {
|
|
2435
2435
|
var d;
|
|
2436
2436
|
const [a, t] = S.useState(!1), r = S.useRef(null), { organizations: n, organization: s } = be(), l = _(), o = K();
|
|
2437
2437
|
return e(C, { children: i($e, { open: a, onOpenChange: t, modal: !1, children: [e(Ge, { asChild: !0, children: s.data && i("button", { className: x("flex w-full items-center gap-x-2.5 rounded-md border border-gray-300 bg-white p-2 text-sm shadow-xs transition-all hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-900", fa), children: [s.data.logoFile ? e(ve, { src: s.data.logoFile.url, alt: s.data.name, width: 40, height: 40, className: "flex aspect-square size-8 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-8 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [s.data.name[0], s.data.name[1]] }), i("div", { className: "flex w-full items-center justify-between gap-x-4 truncate", children: [i("div", { className: "truncate text-left", children: [e("p", { className: "truncate whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-50", children: s.data.name }), e("p", { className: "whitespace-nowrap text-left text-xs text-gray-700 dark:text-gray-300", children: (d = s.data.address) == null ? void 0 : d.addressLineOne })] }), e(Li, { className: "size-5 shrink-0 text-gray-500", "aria-hidden": "true" })] })] }) }), e(Ke, { hidden: !1, onCloseAutoFocus: (u) => {
|
|
@@ -2440,7 +2440,7 @@ const ou = () => {
|
|
|
2440
2440
|
var c;
|
|
2441
2441
|
return e(Ae, { onClick: () => l.push(o.dashboard(u.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [u.logoFile ? e(ve, { src: u.logoFile.url, alt: u.name, width: 40, height: 40, className: "flex aspect-square size-8 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-8 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [u.name[0], u.name[1]] }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: u.name }), e("p", { className: "text-xs text-gray-700 dark:text-gray-400", children: (c = u.address) == null ? void 0 : c.addressLineOne })] })] }) }, u.id);
|
|
2442
2442
|
})] }) })] }) });
|
|
2443
|
-
},
|
|
2443
|
+
}, cu = () => {
|
|
2444
2444
|
const [a, t] = S.useState(!1), r = S.useRef(null), { organizations: n, organization: s } = be(), l = _(), o = K();
|
|
2445
2445
|
return i($e, { open: a, onOpenChange: t, modal: !1, children: [e(Ge, { asChild: !0, children: s.data && i("button", { className: "flex items-center gap-x-1.5 rounded-md p-2 hover:bg-gray-100 focus:outline-hidden dark:hover:bg-gray-900", children: [s.data.logoFile ? e(ve, { src: s.data.logoFile.url, alt: s.data.name, width: 28, height: 28, className: "flex aspect-square size-7 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-7 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [s.data.name[0], s.data.name[1]] }), e(gt, { className: "size-4 shrink-0 text-gray-500", "aria-hidden": "true" }), i("div", { className: "flex w-full items-center justify-between gap-x-3 truncate", children: [e("p", { className: "truncate whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-50", children: s.data.name }), e(Li, { className: "size-4 shrink-0 text-gray-500", "aria-hidden": "true" })] })] }) }), e(Ke, { className: "min-w-72!", onCloseAutoFocus: (d) => {
|
|
2446
2446
|
r.current && (r.current.focus(), r.current = null, d.preventDefault());
|
|
@@ -2449,30 +2449,30 @@ const ou = () => {
|
|
|
2449
2449
|
return e(Ae, { onClick: () => l.push(o.dashboard(d.id)), children: i("div", { className: "flex w-full items-center gap-x-2.5", children: [d.logoFile ? e(ve, { src: d.logoFile.url, alt: d.name, width: 28, height: 28, className: "flex aspect-square size-7 items-center justify-center rounded" }) : i("span", { className: "flex aspect-square size-7 items-center justify-center rounded bg-blue-600 p-2 text-xs font-medium text-white dark:bg-blue-500 uppercase", "aria-hidden": "true", children: [d.name[0], d.name[1]] }), i("div", { children: [e("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-50", children: d.name }), e("p", { className: "text-xs text-gray-700 dark:text-gray-400", children: (u = d.address) == null ? void 0 : u.addressLineOne })] })] }) }, d.id);
|
|
2450
2450
|
})] }) })] });
|
|
2451
2451
|
};
|
|
2452
|
-
function
|
|
2452
|
+
function Cs({ children: a, align: t = "start" }) {
|
|
2453
2453
|
var p, g;
|
|
2454
|
-
const r = _(), [n, s] = A.useState(!1), { theme: l, setTheme: o } =
|
|
2454
|
+
const r = _(), [n, s] = A.useState(!1), { theme: l, setTheme: o } = Is(), d = Fa(), u = K(), c = d.useSession();
|
|
2455
2455
|
A.useEffect(() => {
|
|
2456
2456
|
s(!0);
|
|
2457
2457
|
}, []);
|
|
2458
2458
|
const h = () => d.signOut({ fetchOptions: { onSuccess: () => r.push(u.signIn) } });
|
|
2459
|
-
return n ? e(C, { children: i($e, { children: [e(Ge, { asChild: !0, children: a }), i(Ke, { align: t, children: [e(Tt, { children: (g = (p = c.data) == null ? void 0 : p.user) == null ? void 0 : g.email }), e(Ia, { children: i(
|
|
2459
|
+
return n ? e(C, { children: i($e, { children: [e(Ge, { asChild: !0, children: a }), i(Ke, { align: t, children: [e(Tt, { children: (g = (p = c.data) == null ? void 0 : p.user) == null ? void 0 : g.email }), e(Ia, { children: i(ns, { children: [e(ls, { children: "Theme" }), e(os, { children: i(ss, { value: l, onValueChange: (b) => {
|
|
2460
2460
|
o(b);
|
|
2461
|
-
}, children: [i(Ka, { "aria-label": "Switch to Light Mode", value: "light", iconType: "check", children: [e(
|
|
2461
|
+
}, children: [i(Ka, { "aria-label": "Switch to Light Mode", value: "light", iconType: "check", children: [e(il, { className: "size-4 shrink-0", "aria-hidden": "true" }), "Light"] }), i(Ka, { "aria-label": "Switch to Dark Mode", value: "dark", iconType: "check", children: [e(nl, { className: "size-4 shrink-0", "aria-hidden": "true" }), "Dark"] }), i(Ka, { "aria-label": "Switch to System Mode", value: "system", iconType: "check", children: [e(sl, { className: "size-4 shrink-0", "aria-hidden": "true" }), "System"] })] }) }), e(Ia, { children: e(Ae, { onClick: h, className: "text-red-500", children: "Sign out" }) })] }) })] })] }) }) : null;
|
|
2462
2462
|
}
|
|
2463
|
-
const
|
|
2463
|
+
const mu = () => {
|
|
2464
2464
|
var n;
|
|
2465
2465
|
const a = Fa().useSession(), { firstname: t, lastname: r } = ((n = a.data) == null ? void 0 : n.user) || {};
|
|
2466
|
-
return e(
|
|
2467
|
-
},
|
|
2468
|
-
function
|
|
2469
|
-
const a = We(), t = U(), r = K(), n = [{ name: "Home", href: r.dashboard(t), icon: vi }, { name: "Live Orders", href: r.liveOrders(t), icon: Ni }, { name: "Orders List", href: r.orders(t), icon: Ai }, { name: "Reservations", href: r.reservations(t), icon: Ci }, { name: "Products", href: r.products(t), icon: Si }, { name: "Product Categories", href: r.productCategories(t), icon: Ii }, { name: "Manufacturers", href: r.manufacturers(t), icon: Ei }, { name: "Customers", href: `${r.dashboard(t)}/customers`, icon:
|
|
2470
|
-
return i(C, { children: [e("nav", { className: "hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col", children: i("aside", { className: "flex grow flex-col gap-y-6 overflow-y-auto border-r border-gray-200 bg-slate-50 p-4 dark:border-gray-800 dark:bg-gray-950", children: [e(E, { href: r.home, className: "-ml-2", children: e(
|
|
2466
|
+
return e(Cs, { children: i(z, { "aria-label": "User settings", variant: "ghost", className: X(ye, "group flex w-full items-center justify-between rounded-md p-2 text-sm font-medium text-gray-900 hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10"), children: [i("span", { className: "flex items-center gap-3", children: [i("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: [t == null ? void 0 : t.charAt(0), r == null ? void 0 : r.charAt(0)] }), i("span", { children: [t, " ", r] })] }), e(ll, { className: "size-4 shrink-0 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-400", "aria-hidden": "true" })] }) });
|
|
2467
|
+
}, uu = () => e(Cs, { align: "end", children: e(z, { "aria-label": "User settings", variant: "ghost", className: X("group flex items-center rounded-md p-1 text-sm font-medium text-gray-900 hover:bg-gray-100 data-[state=open]:bg-gray-100 data-[state=open]:bg-gray-400/10 dark:hover:bg-gray-400/10"), children: e("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs text-gray-700 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-300", "aria-hidden": "true", children: "ES" }) }) });
|
|
2468
|
+
function pu() {
|
|
2469
|
+
const a = We(), t = U(), r = K(), n = [{ name: "Home", href: r.dashboard(t), icon: vi }, { name: "Live Orders", href: r.liveOrders(t), icon: Ni }, { name: "Orders List", href: r.orders(t), icon: Ai }, { name: "Reservations", href: r.reservations(t), icon: Ci }, { name: "Products", href: r.products(t), icon: Si }, { name: "Product Categories", href: r.productCategories(t), icon: Ii }, { name: "Manufacturers", href: r.manufacturers(t), icon: Ei }, { name: "Customers", href: `${r.dashboard(t)}/customers`, icon: Hs }, { name: "Settings", href: r.settings(t), icon: Oi }], s = (l) => a === l || (a == null ? void 0 : a.startsWith(l));
|
|
2470
|
+
return i(C, { children: [e("nav", { className: "hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col", children: i("aside", { className: "flex grow flex-col gap-y-6 overflow-y-auto border-r border-gray-200 bg-slate-50 p-4 dark:border-gray-800 dark:bg-gray-950", children: [e(E, { href: r.home, className: "-ml-2", children: e(su, {}) }), e("hr", { className: "block border-t border-gray-200 dark:border-gray-800 -mt-3 mb-1" }), e(du, {}), e("nav", { "aria-label": "core navigation links", className: "flex flex-1 flex-col space-y-10", children: e("ul", { role: "list", className: "space-y-0.5", children: n.map((l) => e("li", { children: i(E, { href: l.href, className: x(s(l.href) ? "text-blue-600 dark:text-blue-400" : "text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50", "flex items-center gap-x-2.5 rounded-md px-2 py-1.5 text-sm font-medium transition hover:bg-gray-100 dark:hover:bg-gray-900", ye), children: [e(l.icon, { className: "size-4 shrink-0", "aria-hidden": "true" }), l.name] }) }, l.name)) }) }), e("div", { className: "mt-auto", children: e(mu, {}) })] }) }), i("div", { className: "sticky top-0 z-40 flex h-16 shrink-0 items-center justify-between border-b border-gray-200 bg-white px-2 shadow-xs sm:gap-x-6 sm:px-4 lg:hidden dark:border-gray-800 dark:bg-gray-950", children: [e(cu, {}), i("div", { className: "flex items-center gap-1 sm:gap-2", children: [e(uu, {}), e(ou, {})] })] })] });
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2473
|
-
return i(C, { children: [e("div", { className: "bg-slate-50 dark:hidden w-1/2 absolute top-0 left-0 h-screen" }), i("div", { className: "mx-auto max-w-(--breakpoint-2xl)", children: [e(
|
|
2472
|
+
function hu({ children: a, view: t }) {
|
|
2473
|
+
return i(C, { children: [e("div", { className: "bg-slate-50 dark:hidden w-1/2 absolute top-0 left-0 h-screen" }), i("div", { className: "mx-auto max-w-(--breakpoint-2xl)", children: [e(pu, {}), e("main", { className: "lg:pl-72 bg-white dark:bg-gray-950 z-10 relative min-h-screen", children: e("div", { className: "relative", children: i("div", { className: "p-4 sm:px-6 sm:pb-10 sm:pt-10 lg:px-10 lg:pt-[34px]", children: [e(nu, { view: t }), a] }) }) })] })] });
|
|
2474
2474
|
}
|
|
2475
|
-
function
|
|
2475
|
+
function gu(a) {
|
|
2476
2476
|
if (a.length === 0) return { type: "home" };
|
|
2477
2477
|
const [t, r, n, s, l] = a;
|
|
2478
2478
|
if (t === "auth") return r === "sign-in" ? { type: "sign-in" } : r === "sign-up" ? { type: "sign-up" } : { type: "not-found" };
|
|
@@ -2480,110 +2480,110 @@ function hu(a) {
|
|
|
2480
2480
|
const o = t;
|
|
2481
2481
|
return r ? r === "dashboard" ? { type: "dashboard", orgId: o } : r === "orders" ? { type: "orders", orgId: o } : r === "reservations" ? { type: "reservations", orgId: o } : r === "products" ? n ? n === "create" ? { type: "product-create", orgId: o } : { type: "product-edit", orgId: o, id: n } : { type: "products-list", orgId: o } : r === "product-categories" ? n ? n === "create" ? { type: "product-category-create", orgId: o } : { type: "product-category-edit", orgId: o, id: n } : { type: "product-categories-list", orgId: o } : r === "manufacturers" ? n ? n === "create" ? { type: "manufacturer-create", orgId: o } : { type: "manufacturer-edit", orgId: o, id: n } : { type: "manufacturers-list", orgId: o } : r === "settings" ? n ? n === "opening-times" ? { type: "settings-opening-times", orgId: o } : n === "shipping-methods" ? s ? s === "create" ? { type: "shipping-method-create", orgId: o } : { type: "shipping-method-edit", orgId: o, id: s } : { type: "shipping-methods-list", orgId: o } : n === "access" ? s ? s === "invite" ? { type: "access-invite", orgId: o } : { type: "access-member-edit", orgId: o, id: s } : { type: "access-list", orgId: o } : { type: "settings", orgId: o } : { type: "settings", orgId: o } : { type: "not-found" } : { type: "not-found" };
|
|
2482
2482
|
}
|
|
2483
|
-
function
|
|
2484
|
-
const t = Fa(), r = K(), n = _(), s = We(), l = fe(), { data: o, isPending: d } = t.useSession(), u =
|
|
2483
|
+
function gp({ segments: a }) {
|
|
2484
|
+
const t = Fa(), r = K(), n = _(), s = We(), l = fe(), { data: o, isPending: d } = t.useSession(), u = gu(a), c = u.type === "sign-in" || u.type === "sign-up", h = u.type === "home" || u.type === "organizations", p = l == null ? void 0 : l.get("redirect"), g = l == null ? void 0 : l.toString(), b = s ? `${s}${g ? `?${g}` : ""}` : r.home, f = c ? Ft(p, r) : b;
|
|
2485
2485
|
if (ee(() => {
|
|
2486
2486
|
if (!d) {
|
|
2487
2487
|
if (!o && !c) {
|
|
2488
|
-
n.replace(
|
|
2488
|
+
n.replace(wr(r.signIn, f));
|
|
2489
2489
|
return;
|
|
2490
2490
|
}
|
|
2491
2491
|
o && c && n.replace(f);
|
|
2492
2492
|
}
|
|
2493
2493
|
}, [o, d, c, n, r.signIn, f]), d) return e("div", { className: "flex justify-center items-center h-screen", children: e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600" }) });
|
|
2494
2494
|
if (c) {
|
|
2495
|
-
if (u.type === "sign-in") return e(
|
|
2496
|
-
if (u.type === "sign-up") return e(
|
|
2495
|
+
if (u.type === "sign-in") return e(mc, {});
|
|
2496
|
+
if (u.type === "sign-up") return e(pc, {});
|
|
2497
2497
|
}
|
|
2498
2498
|
if (!o) return null;
|
|
2499
|
-
if (h) return e(ii, { children: e(
|
|
2500
|
-
if (u.type === "not-found") return e(
|
|
2499
|
+
if (h) return e(ii, { children: e(om, {}) });
|
|
2500
|
+
if (u.type === "not-found") return e(Jn, {});
|
|
2501
2501
|
const w = "orgId" in u ? u.orgId : void 0, y = "id" in u ? u.id : void 0;
|
|
2502
|
-
return e(
|
|
2502
|
+
return e(tc, { organizationId: w, id: y, children: e(ii, { children: e(nc, { children: e(hu, { view: u, children: fu(u) }) }) }) });
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function fu(a) {
|
|
2505
2505
|
switch (a.type) {
|
|
2506
2506
|
case "dashboard":
|
|
2507
|
-
return e(
|
|
2507
|
+
return e(vc, {});
|
|
2508
2508
|
case "orders":
|
|
2509
|
-
return e(
|
|
2509
|
+
return e(nm, {});
|
|
2510
2510
|
case "reservations":
|
|
2511
|
-
return e(
|
|
2511
|
+
return e(Lm, {});
|
|
2512
2512
|
case "products-list":
|
|
2513
|
-
return e(
|
|
2513
|
+
return e(Bm, {});
|
|
2514
2514
|
case "product-create":
|
|
2515
|
-
return e(Sm, {});
|
|
2516
|
-
case "product-edit":
|
|
2517
2515
|
return e(Im, {});
|
|
2516
|
+
case "product-edit":
|
|
2517
|
+
return e(Em, {});
|
|
2518
2518
|
case "product-categories-list":
|
|
2519
|
-
return e(
|
|
2519
|
+
return e(bm, {});
|
|
2520
2520
|
case "product-category-create":
|
|
2521
|
-
return e(xm, {});
|
|
2522
|
-
case "product-category-edit":
|
|
2523
2521
|
return e(wm, {});
|
|
2522
|
+
case "product-category-edit":
|
|
2523
|
+
return e(km, {});
|
|
2524
2524
|
case "manufacturers-list":
|
|
2525
|
-
return e(
|
|
2525
|
+
return e(Yc, {});
|
|
2526
2526
|
case "manufacturer-create":
|
|
2527
|
-
return e(Jc, {});
|
|
2528
|
-
case "manufacturer-edit":
|
|
2529
2527
|
return e(Oc, {});
|
|
2528
|
+
case "manufacturer-edit":
|
|
2529
|
+
return e(Lc, {});
|
|
2530
2530
|
case "settings":
|
|
2531
|
-
return e(Ve, { children: e(
|
|
2531
|
+
return e(Ve, { children: e(ru, {}) });
|
|
2532
2532
|
case "settings-opening-times":
|
|
2533
|
-
return e(Ve, { children: e(
|
|
2533
|
+
return e(Ve, { children: e($m, {}) });
|
|
2534
2534
|
case "shipping-methods-list":
|
|
2535
|
-
return e(Ve, { children: e(
|
|
2535
|
+
return e(Ve, { children: e(eu, {}) });
|
|
2536
2536
|
case "shipping-method-create":
|
|
2537
|
-
return e(Ve, { children: e($m, {}) });
|
|
2538
|
-
case "shipping-method-edit":
|
|
2539
2537
|
return e(Ve, { children: e(Gm, {}) });
|
|
2538
|
+
case "shipping-method-edit":
|
|
2539
|
+
return e(Ve, { children: e(Km, {}) });
|
|
2540
2540
|
case "access-list":
|
|
2541
|
-
return e(Ve, { children: e(
|
|
2541
|
+
return e(Ve, { children: e(Um, {}) });
|
|
2542
2542
|
case "access-invite":
|
|
2543
|
-
return e(Ve, { children: e(
|
|
2543
|
+
return e(Ve, { children: e(Vm, {}) });
|
|
2544
2544
|
case "access-member-edit":
|
|
2545
|
-
return e(Ve, { children: e(
|
|
2545
|
+
return e(Ve, { children: e(qm, {}) });
|
|
2546
2546
|
default:
|
|
2547
|
-
return e(
|
|
2547
|
+
return e(Jn, {});
|
|
2548
2548
|
}
|
|
2549
2549
|
}
|
|
2550
2550
|
export {
|
|
2551
2551
|
xe as $,
|
|
2552
|
-
|
|
2553
|
-
|
|
2552
|
+
Xu as A,
|
|
2553
|
+
tp as B,
|
|
2554
2554
|
jl as C,
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2555
|
+
rp as D,
|
|
2556
|
+
Jn as E,
|
|
2557
|
+
pp as F,
|
|
2558
|
+
hp as G,
|
|
2559
|
+
Wi as H,
|
|
2560
2560
|
I,
|
|
2561
2561
|
Ne as J,
|
|
2562
2562
|
Y as K,
|
|
2563
2563
|
Mo as L,
|
|
2564
|
-
|
|
2564
|
+
op as M,
|
|
2565
2565
|
Yo as N,
|
|
2566
|
-
|
|
2566
|
+
yr as O,
|
|
2567
2567
|
_o as P,
|
|
2568
|
-
|
|
2568
|
+
dp as Q,
|
|
2569
2569
|
Uo as R,
|
|
2570
2570
|
ud as S,
|
|
2571
2571
|
Zo as T,
|
|
2572
2572
|
$o as U,
|
|
2573
|
-
|
|
2573
|
+
An as V,
|
|
2574
2574
|
De as W,
|
|
2575
2575
|
qo as X,
|
|
2576
|
-
|
|
2576
|
+
Sn as Y,
|
|
2577
2577
|
Ee as Z,
|
|
2578
2578
|
Xo as _,
|
|
2579
|
-
|
|
2579
|
+
gp as a,
|
|
2580
2580
|
It as a0,
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2581
|
+
np as a1,
|
|
2582
|
+
ur as a2,
|
|
2583
|
+
pr as a3,
|
|
2584
|
+
hr as a4,
|
|
2585
|
+
gr as a5,
|
|
2586
|
+
fr as a6,
|
|
2587
2587
|
Lo as a7,
|
|
2588
2588
|
Oo as a8,
|
|
2589
2589
|
Ct as a9,
|
|
@@ -2591,8 +2591,8 @@ export {
|
|
|
2591
2591
|
St as ab,
|
|
2592
2592
|
To as ac,
|
|
2593
2593
|
Jo as ad,
|
|
2594
|
-
|
|
2595
|
-
|
|
2594
|
+
kn as ae,
|
|
2595
|
+
mr as af,
|
|
2596
2596
|
Po as ag,
|
|
2597
2597
|
Ra as ah,
|
|
2598
2598
|
jo as ai,
|
|
@@ -2613,27 +2613,27 @@ export {
|
|
|
2613
2613
|
Sa as ax,
|
|
2614
2614
|
Fl as b,
|
|
2615
2615
|
zl as c,
|
|
2616
|
-
|
|
2616
|
+
nr as d,
|
|
2617
2617
|
wt as e,
|
|
2618
2618
|
Ul as f,
|
|
2619
2619
|
Dl as g,
|
|
2620
2620
|
Gl as h,
|
|
2621
|
-
|
|
2621
|
+
ip as i,
|
|
2622
2622
|
ql as j,
|
|
2623
|
-
|
|
2623
|
+
_r as k,
|
|
2624
2624
|
vd as l,
|
|
2625
|
-
|
|
2626
|
-
|
|
2625
|
+
sp as m,
|
|
2626
|
+
lp as n,
|
|
2627
2627
|
jd as o,
|
|
2628
2628
|
Vd as p,
|
|
2629
2629
|
Zd as q,
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2630
|
+
cp as r,
|
|
2631
|
+
mp as s,
|
|
2632
|
+
up as t,
|
|
2633
|
+
sr as u,
|
|
2634
2634
|
Hl as v,
|
|
2635
2635
|
Vl as w,
|
|
2636
|
-
|
|
2636
|
+
ep as x,
|
|
2637
2637
|
we as y,
|
|
2638
|
-
|
|
2638
|
+
ap as z
|
|
2639
2639
|
};
|