@loczer/storefront-sdk 0.197.0 → 0.199.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StorefrontContext.d.ts +483 -0
- package/dist/StorefrontContext.d.ts.map +1 -0
- package/dist/StorefrontContext.js +39 -0
- package/dist/StorefrontProvider.d.ts +6 -486
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +34 -67
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-DOH1GYVR.js} +1 -0
- package/dist/components/AboutSection/index.js +5 -5
- package/dist/components/BikeProductCard/index.d.ts +2 -1
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +28 -28
- package/dist/components/BookingBikeQuickAddCard/index.d.ts +19 -0
- package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -0
- package/dist/components/BookingBikeQuickAddCard/index.js +174 -0
- package/dist/components/BookingBikeVariantDialog/index.d.ts +5 -2
- package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -1
- package/dist/components/BookingBikeVariantDialog/index.js +85 -93
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/ContactSection/index.js +107 -107
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +117 -111
- package/dist/components/Header/index.js +4 -4
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +47 -40
- package/dist/components/PlatformFooter/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts +2 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +72 -70
- package/dist/components/TestimonialsSection/index.js +1 -1
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -0
- package/dist/i18n/fr.d.ts +3 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +3 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.js +59 -58
- package/dist/lib/cartSummary.js +7 -7
- package/dist/lib/products.d.ts +6 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +36 -32
- package/dist/lib/toast.d.ts +9 -0
- package/dist/lib/toast.d.ts.map +1 -0
- package/dist/lib/toast.js +13 -0
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +323 -396
- package/dist/pages/CheckoutPage.js +217 -217
- package/dist/pages/CheckoutPaymentPage.js +124 -124
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +83 -83
- package/dist/pages/ErrorPage.d.ts.map +1 -1
- package/dist/pages/ErrorPage.js +13 -13
- package/dist/pages/HomePage.js +6 -3
- package/dist/pages/NotFoundPage.js +1 -1
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +177 -165
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
- package/dist/storefront.css +1 -1
- package/dist/ui/button.js +3 -3
- package/package.json +3 -1
|
@@ -1,98 +1,99 @@
|
|
|
1
1
|
import { getBookingParamsFromSearch as e, resolveBookingSearchParamsFromSessionStorage as t, writeBookingSearchParamsToSessionStorage as n } from "../lib/booking.js";
|
|
2
2
|
import { getProductVariantAttributeValue as r, getStorefrontProductVariantDisplay as i } from "../lib/productVariants.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ROUTE as
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Button as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
3
|
+
import { getLocalizedValue as a } from "../localization.js";
|
|
4
|
+
import { findStorefrontProductBySlug as o, getStorefrontCheckoutProductId as s, getStorefrontProductSelectionDisplayName as c } from "../lib/products.js";
|
|
5
|
+
import { useStorefrontCart as ee } from "../lib/cart.js";
|
|
6
|
+
import { getAvailabilityVariant as te } from "../lib/utils.js";
|
|
7
|
+
import { ROUTE as ne, buildStorefrontAvailabilityKey as l, getStorefrontAvailabilityIssue as u, getStorefrontAvailabilityStatus as d, getValidStorefrontAvailabilitySchedule as re, isStorefrontAvailabilityInsufficient as ie, responseSchema as ae } from "../lib/storefrontAvailability.js";
|
|
8
|
+
import { Badge as f } from "../ui/badge.js";
|
|
9
|
+
import { Button as p } from "../ui/button.js";
|
|
10
|
+
import { toast as oe } from "../lib/toast.js";
|
|
11
|
+
import { Input as se } from "../ui/input.js";
|
|
12
|
+
import { useStorefront as ce, useStorefrontProducts as le } from "../StorefrontContext.js";
|
|
13
|
+
import { Card as ue } from "../ui/card.js";
|
|
14
|
+
import { ProductWarningNotice as de } from "../components/ProductWarningNotice/index.js";
|
|
15
|
+
import { ProductPriceBadge as fe } from "../components/ProductPriceBadge/index.js";
|
|
16
|
+
import { resolveProductImageContainerStyle as pe } from "../lib/productImageStyles.js";
|
|
17
|
+
import { apiPost as me } from "../lib/apiCall.js";
|
|
18
|
+
import { RadioGroup as he, RadioGroupItem as ge } from "../ui/radio-group.js";
|
|
19
|
+
import { useEffect as m, useMemo as h, useState as g } from "react";
|
|
20
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
21
|
+
import { Link as y, useLocation as _e, useNavigate as ve, useParams as ye, useSearchParams as be } from "@rpcbase/router";
|
|
22
|
+
import { useTranslation as xe } from "react-i18next";
|
|
23
|
+
import { cn as b } from "@rpcbase/ui";
|
|
24
|
+
import { ArrowLeft as x, ArrowRight as S, Bike as Se, CheckCircle2 as Ce, Plus as we } from "lucide-react";
|
|
24
25
|
//#region src/pages/ProductPage.tsx
|
|
25
|
-
var
|
|
26
|
+
var C = (e, t = () => !0) => {
|
|
26
27
|
if (!e) return null;
|
|
27
28
|
if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
|
|
28
29
|
let n = e.productVariants ?? [];
|
|
29
30
|
return n.find((e) => t(e.id))?.id ?? n[0]?.id ?? null;
|
|
30
|
-
},
|
|
31
|
+
}, Te = (e, t) => {
|
|
31
32
|
if (!e) return [];
|
|
32
|
-
let n =
|
|
33
|
-
r.set(
|
|
33
|
+
let n = s(e), r = /* @__PURE__ */ new Map();
|
|
34
|
+
r.set(l(n), {
|
|
34
35
|
productId: n,
|
|
35
36
|
quantity: t
|
|
36
37
|
});
|
|
37
|
-
for (let i of e.productVariants ?? []) r.set(
|
|
38
|
+
for (let i of e.productVariants ?? []) r.set(l(n, i.id), {
|
|
38
39
|
productId: n,
|
|
39
40
|
productVariantId: i.id,
|
|
40
41
|
quantity: t
|
|
41
42
|
});
|
|
42
43
|
let i = e.representedVariantId?.trim();
|
|
43
|
-
return i && r.set(
|
|
44
|
+
return i && r.set(l(n, i), {
|
|
44
45
|
productId: n,
|
|
45
46
|
productVariantId: i,
|
|
46
47
|
quantity: t
|
|
47
48
|
}), Array.from(r.values());
|
|
48
|
-
},
|
|
49
|
-
let n =
|
|
49
|
+
}, Ee = (e, t) => {
|
|
50
|
+
let n = s(e), r = e.representedVariantId?.trim();
|
|
50
51
|
if (r) {
|
|
51
|
-
let e = t.get(
|
|
52
|
+
let e = t.get(l(n, r));
|
|
52
53
|
if (e) return e;
|
|
53
54
|
}
|
|
54
|
-
return t.get(
|
|
55
|
-
},
|
|
56
|
-
let r =
|
|
55
|
+
return t.get(l(n));
|
|
56
|
+
}, De = (e, t, n) => n.get(l(s(e), t)), w = (e, t, n) => {
|
|
57
|
+
let r = u(t);
|
|
57
58
|
return r === "quantity_unavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
|
|
58
|
-
},
|
|
59
|
-
function
|
|
60
|
-
let { t:
|
|
61
|
-
bikes:
|
|
62
|
-
accessories:
|
|
59
|
+
}, Oe = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
|
|
60
|
+
function T() {
|
|
61
|
+
let { t: u, i18n: T } = xe(), { storeSlug: E, productSlug: D } = ye(), [O] = be(), ke = _e(), Ae = ve(), { addItem: je, itemCount: k } = ee(), { storefrontConfiguration: Me } = ce(), A = Me.workspace?.workspaceLanguage, { bikes: j, accessories: M } = le(), N = h(() => D ? o(D, {
|
|
62
|
+
bikes: j,
|
|
63
|
+
accessories: M
|
|
63
64
|
}) : null, [
|
|
64
|
-
N,
|
|
65
65
|
M,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
j,
|
|
67
|
+
D
|
|
68
|
+
]), P = h(() => t(O, E), [O, E]), F = h(() => e(P, {
|
|
68
69
|
start_time: "",
|
|
69
70
|
end_time: ""
|
|
70
|
-
}), [
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
71
|
+
}), [P]), I = h(() => re(F), [F]), L = P.toString(), R = `/${E ?? ""}/checkout${L ? `?${L}` : ""}`, z = `/${E ?? ""}`, Ne = z, B = ke.state, Pe = typeof B?.backTo == "string" && B.backTo.startsWith(z) ? B.backTo : Ne, [V, H] = g(1), [U, W] = g(() => C(N)), G = Number.isFinite(V) ? Math.max(1, Math.min(99, Math.floor(V))) : 1, K = h(() => Te(N, G), [G, N]), [q, J] = g([]), [Fe, Y] = g(!1);
|
|
72
|
+
m(() => {
|
|
73
|
+
if (H(1), !N) {
|
|
74
|
+
W(null);
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
n(
|
|
79
|
-
}, [
|
|
80
|
-
if (!
|
|
77
|
+
W(C(N));
|
|
78
|
+
}, [D, N]), m(() => {
|
|
79
|
+
n(E, P);
|
|
80
|
+
}, [P, E]), m(() => {
|
|
81
|
+
if (!E || K.length === 0) {
|
|
81
82
|
J([]), Y(!1);
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
|
-
if (!
|
|
85
|
+
if (!I) {
|
|
85
86
|
J([]), Y(!1);
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
89
|
let e = !1;
|
|
89
90
|
return Y(!0), J([]), (async () => {
|
|
90
91
|
try {
|
|
91
|
-
let t = await
|
|
92
|
-
storeSlug:
|
|
93
|
-
schedule:
|
|
94
|
-
products:
|
|
95
|
-
}), n =
|
|
92
|
+
let t = await me(ne, {
|
|
93
|
+
storeSlug: E,
|
|
94
|
+
schedule: I,
|
|
95
|
+
products: K
|
|
96
|
+
}), n = ae.parse(t);
|
|
96
97
|
if (e) return;
|
|
97
98
|
J(n.success ? n.availability ?? [] : []);
|
|
98
99
|
} catch (t) {
|
|
@@ -105,185 +106,188 @@ function E() {
|
|
|
105
106
|
e = !0;
|
|
106
107
|
};
|
|
107
108
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
K,
|
|
110
|
+
I,
|
|
111
|
+
F.end_date,
|
|
112
|
+
F.end_time,
|
|
113
|
+
F.start_date,
|
|
114
|
+
F.start_time,
|
|
115
|
+
E
|
|
115
116
|
]);
|
|
116
|
-
let
|
|
117
|
-
|
|
117
|
+
let X = h(() => new Map(q.map((e) => [l(e.productId, e.productVariantId), e])), [q]), Ie = () => {
|
|
118
|
+
Ae(Pe);
|
|
118
119
|
};
|
|
119
|
-
if (!
|
|
120
|
+
if (!N) return /* @__PURE__ */ _("div", {
|
|
120
121
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ v("div", {
|
|
122
123
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
123
124
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ _("h1", {
|
|
125
126
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ _("span", { children: u("product_not_found_title") })
|
|
127
128
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ _("p", {
|
|
129
130
|
className: "mt-2 text-sm text-slate-600",
|
|
130
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ _("span", { children: u("product_not_found_description") })
|
|
131
132
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ _("div", {
|
|
133
134
|
className: "mt-6",
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ v(p, {
|
|
135
136
|
type: "button",
|
|
136
137
|
className: "gap-2",
|
|
137
|
-
onClick:
|
|
138
|
-
children: [/* @__PURE__ */
|
|
138
|
+
onClick: Ie,
|
|
139
|
+
children: [/* @__PURE__ */ _(x, {
|
|
139
140
|
className: "h-4 w-4",
|
|
140
141
|
"aria-hidden": "true"
|
|
141
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ _("span", { children: u("go_back") })]
|
|
142
143
|
})
|
|
143
144
|
})
|
|
144
145
|
]
|
|
145
146
|
})
|
|
146
147
|
});
|
|
147
|
-
let
|
|
148
|
-
return /* @__PURE__ */
|
|
148
|
+
let Z = a(N.name, T.language, A), Le = a(N.description, T.language, A), Re = a(N.warning, T.language, A), ze = typeof N.images?.[0] == "string" ? N.images[0].trim() : "", Be = pe(N.primaryImageStyle), Q = Ee(N, X), Ve = Oe(N), He = Q ? d(Q) : Ve, Ue = te(He), We = Fe ? u("availability_checking") : w(u, Q, He), Ge = Q ? ie(Q) : Ve === "OUT_OF_STOCK", $ = N.productVariants ?? [], Ke = $.some((e) => !!r(e, "size")) ? u("product_size_label") : u("product_variant_label"), qe = !!U && I !== null;
|
|
149
|
+
return /* @__PURE__ */ _("div", {
|
|
149
150
|
className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
|
|
150
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ v("div", {
|
|
151
152
|
className: "flex flex-col gap-6",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ v("div", {
|
|
153
154
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ v(p, {
|
|
155
156
|
type: "button",
|
|
156
157
|
variant: "ghost",
|
|
157
158
|
className: "h-auto justify-start gap-2 self-start px-0 text-sm font-medium text-slate-700 hover:bg-transparent hover:text-slate-950",
|
|
158
|
-
onClick:
|
|
159
|
-
children: [/* @__PURE__ */
|
|
159
|
+
onClick: Ie,
|
|
160
|
+
children: [/* @__PURE__ */ _(x, {
|
|
160
161
|
className: "h-4 w-4",
|
|
161
162
|
"aria-hidden": "true"
|
|
162
|
-
}), /* @__PURE__ */
|
|
163
|
-
}), /* @__PURE__ */ y
|
|
164
|
-
to:
|
|
165
|
-
className:
|
|
166
|
-
children: /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ _("span", { children: u("go_back") })]
|
|
164
|
+
}), /* @__PURE__ */ _(y, {
|
|
165
|
+
to: R,
|
|
166
|
+
className: b(k > 0 && I ? "inline-flex" : "hidden"),
|
|
167
|
+
children: /* @__PURE__ */ v(p, {
|
|
167
168
|
size: "sm",
|
|
168
169
|
className: "gap-2",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ _("span", { children: u("checkout_button") }), /* @__PURE__ */ _(S, {
|
|
170
171
|
className: "h-4 w-4",
|
|
171
172
|
"aria-hidden": "true"
|
|
172
173
|
})]
|
|
173
174
|
})
|
|
174
175
|
})]
|
|
175
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ v("div", {
|
|
176
177
|
className: "grid gap-6 lg:grid-cols-12",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ v("div", {
|
|
178
179
|
className: "lg:col-span-7",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
-
className:
|
|
181
|
-
style:
|
|
182
|
-
children:
|
|
183
|
-
src:
|
|
184
|
-
alt:
|
|
180
|
+
children: [/* @__PURE__ */ _("div", {
|
|
181
|
+
className: b("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Be.className),
|
|
182
|
+
style: Be.style,
|
|
183
|
+
children: ze ? /* @__PURE__ */ _("img", {
|
|
184
|
+
src: ze,
|
|
185
|
+
alt: Z,
|
|
185
186
|
className: "absolute inset-0 h-full w-full object-contain p-2",
|
|
186
187
|
loading: "lazy"
|
|
187
|
-
}) : /* @__PURE__ */
|
|
188
|
+
}) : /* @__PURE__ */ _("div", {
|
|
188
189
|
className: "absolute inset-0 flex items-center justify-center text-slate-400",
|
|
189
|
-
children: /* @__PURE__ */
|
|
190
|
+
children: /* @__PURE__ */ _(Se, {
|
|
190
191
|
className: "h-12 w-12",
|
|
191
192
|
"aria-hidden": "true"
|
|
192
193
|
})
|
|
193
194
|
})
|
|
194
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ v("div", {
|
|
195
196
|
className: "mt-5 flex flex-col gap-3",
|
|
196
197
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ v("div", {
|
|
198
199
|
className: "flex flex-wrap items-center gap-2",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
-
variant:
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
}), /* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ _(f, {
|
|
201
|
+
variant: Ue.variant,
|
|
202
|
+
children: /* @__PURE__ */ _("span", { children: We })
|
|
203
|
+
}), /* @__PURE__ */ _(fe, {
|
|
204
|
+
prices: N.prices,
|
|
205
|
+
openOnHover: N.kind !== "accessory"
|
|
206
|
+
})]
|
|
203
207
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ _("h1", {
|
|
205
209
|
className: "text-2xl font-semibold tracking-tight text-slate-950",
|
|
206
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ _("span", { children: Z })
|
|
207
211
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ _("p", {
|
|
209
213
|
className: "text-sm text-slate-600",
|
|
210
|
-
children: /* @__PURE__ */
|
|
214
|
+
children: /* @__PURE__ */ _("span", { children: Le })
|
|
211
215
|
}),
|
|
212
|
-
|
|
216
|
+
N.features?.length ? /* @__PURE__ */ v("div", {
|
|
213
217
|
className: "mt-2 space-y-2",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ _("p", {
|
|
215
219
|
className: "text-sm font-semibold text-slate-950",
|
|
216
|
-
children: /* @__PURE__ */
|
|
217
|
-
}), /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ _("span", { children: u("product_features_title") })
|
|
221
|
+
}), /* @__PURE__ */ _("ul", {
|
|
218
222
|
className: "grid gap-1 text-sm text-slate-700",
|
|
219
|
-
children:
|
|
223
|
+
children: N.features.map((e, t) => /* @__PURE__ */ v("li", {
|
|
220
224
|
className: "inline-flex items-start gap-2",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ _(Ce, {
|
|
222
226
|
className: "mt-0.5 h-4 w-4 text-success",
|
|
223
227
|
"aria-hidden": "true"
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
-
}, `${
|
|
228
|
+
}), /* @__PURE__ */ _("span", { children: a(e, T.language, A) })]
|
|
229
|
+
}, `${N.id}-${t}`))
|
|
226
230
|
})]
|
|
227
231
|
}) : null,
|
|
228
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ _(de, { warning: Re })
|
|
229
233
|
]
|
|
230
234
|
})]
|
|
231
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ _("div", {
|
|
232
236
|
className: "lg:col-span-5",
|
|
233
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ v(ue, {
|
|
234
238
|
className: "border-slate-200 bg-white shadow-sm",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ v("div", {
|
|
236
240
|
className: "border-b border-slate-200 px-4 py-4",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ _("p", {
|
|
238
242
|
className: "text-sm font-semibold text-slate-950",
|
|
239
|
-
children: /* @__PURE__ */
|
|
240
|
-
}), /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ _("span", { children: u("add_to_cart_title") })
|
|
244
|
+
}), /* @__PURE__ */ _("p", {
|
|
241
245
|
className: "mt-1 text-xs text-slate-600",
|
|
242
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ _("span", { children: u("add_to_cart_description") })
|
|
243
247
|
})]
|
|
244
|
-
}), /* @__PURE__ */
|
|
248
|
+
}), /* @__PURE__ */ v("div", {
|
|
245
249
|
className: "grid gap-4 px-4 py-4",
|
|
246
250
|
children: [
|
|
247
|
-
|
|
251
|
+
I ? null : /* @__PURE__ */ _("p", {
|
|
248
252
|
role: "alert",
|
|
249
253
|
className: "text-sm text-destructive",
|
|
250
|
-
children: /* @__PURE__ */
|
|
254
|
+
children: /* @__PURE__ */ _("span", { children: u("booking_time_slots_required") })
|
|
251
255
|
}),
|
|
252
|
-
$.length > 1 ? /* @__PURE__ */
|
|
256
|
+
$.length > 1 ? /* @__PURE__ */ v("div", {
|
|
253
257
|
className: "grid gap-2",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ _("p", {
|
|
255
259
|
className: "text-xs font-medium text-slate-700",
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
value:
|
|
259
|
-
onValueChange:
|
|
260
|
+
children: /* @__PURE__ */ _("span", { children: Ke })
|
|
261
|
+
}), /* @__PURE__ */ _(he, {
|
|
262
|
+
value: U ?? "",
|
|
263
|
+
onValueChange: W,
|
|
260
264
|
className: "grid gap-2",
|
|
261
265
|
children: $.map((e) => {
|
|
262
|
-
let t = `variant-${
|
|
263
|
-
return /* @__PURE__ */
|
|
266
|
+
let t = `variant-${N.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${N.id}-${e.id}`.toLowerCase(), { label: r, description: a } = i(e), o = De(N, e.id, X), s = o ? ie(o) : Ge, c = o ? w(u, o, d(o)) : Ge ? u("availability_out_of_stock") : null;
|
|
267
|
+
return /* @__PURE__ */ v("label", {
|
|
264
268
|
htmlFor: t,
|
|
265
269
|
"data-testid": n,
|
|
266
|
-
className:
|
|
267
|
-
children: [/* @__PURE__ */
|
|
270
|
+
className: b("flex items-start gap-3 rounded-xl border p-3 transition", U === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
|
|
271
|
+
children: [/* @__PURE__ */ _(ge, {
|
|
268
272
|
id: t,
|
|
269
273
|
value: e.id,
|
|
270
274
|
className: "mt-1"
|
|
271
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ v("span", {
|
|
272
276
|
className: "flex flex-1 flex-col gap-0.5",
|
|
273
277
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ _("span", {
|
|
275
279
|
className: "text-sm font-medium text-slate-950",
|
|
276
280
|
children: r
|
|
277
281
|
}),
|
|
278
|
-
a ? /* @__PURE__ */
|
|
282
|
+
a ? /* @__PURE__ */ _("span", {
|
|
279
283
|
className: "text-xs text-slate-600",
|
|
280
284
|
children: a
|
|
281
285
|
}) : null,
|
|
282
|
-
c ? /* @__PURE__ */
|
|
286
|
+
c ? /* @__PURE__ */ _("span", {
|
|
283
287
|
className: "pt-1",
|
|
284
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ _(f, {
|
|
285
289
|
variant: s ? "destructive" : "outline",
|
|
286
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ _("span", { children: c })
|
|
287
291
|
})
|
|
288
292
|
}) : null
|
|
289
293
|
]
|
|
@@ -292,42 +296,50 @@ function E() {
|
|
|
292
296
|
})
|
|
293
297
|
})]
|
|
294
298
|
}) : null,
|
|
295
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ v("div", {
|
|
296
300
|
className: "grid gap-2",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ _("p", {
|
|
298
302
|
className: "text-xs font-medium text-slate-700",
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
-
}), /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ _("span", { children: u("quantity_label") })
|
|
304
|
+
}), /* @__PURE__ */ _(se, {
|
|
301
305
|
type: "number",
|
|
302
306
|
min: 1,
|
|
303
307
|
max: 99,
|
|
304
|
-
value:
|
|
305
|
-
onChange: (e) =>
|
|
308
|
+
value: V,
|
|
309
|
+
onChange: (e) => H(Number(e.target.value))
|
|
306
310
|
})]
|
|
307
311
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ v(p, {
|
|
309
313
|
className: "h-11 rounded-xl text-sm font-semibold gap-2",
|
|
310
314
|
onClick: () => {
|
|
311
|
-
!
|
|
312
|
-
kind:
|
|
313
|
-
productId:
|
|
314
|
-
...
|
|
315
|
-
quantity:
|
|
316
|
-
})
|
|
315
|
+
!U || !I || (je({
|
|
316
|
+
kind: N.kind,
|
|
317
|
+
productId: s(N),
|
|
318
|
+
...U ? { productVariantId: U } : {},
|
|
319
|
+
quantity: G
|
|
320
|
+
}), oe.success(u("product_added_to_cart_successfully", {
|
|
321
|
+
quantity: G,
|
|
322
|
+
productName: c({
|
|
323
|
+
product: N,
|
|
324
|
+
productVariantId: U,
|
|
325
|
+
language: T.language,
|
|
326
|
+
fallbackLanguage: A
|
|
327
|
+
})
|
|
328
|
+
})));
|
|
317
329
|
},
|
|
318
|
-
disabled: !
|
|
319
|
-
children: [/* @__PURE__ */
|
|
330
|
+
disabled: !qe,
|
|
331
|
+
children: [/* @__PURE__ */ _("span", { children: u("add_to_cart") }), /* @__PURE__ */ _(we, {
|
|
320
332
|
className: "h-4 w-4",
|
|
321
333
|
"aria-hidden": "true"
|
|
322
334
|
})]
|
|
323
335
|
}),
|
|
324
|
-
/* @__PURE__ */ y
|
|
325
|
-
to:
|
|
326
|
-
className:
|
|
327
|
-
children: /* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ _(y, {
|
|
337
|
+
to: R,
|
|
338
|
+
className: b(k > 0 && I ? "block" : "hidden"),
|
|
339
|
+
children: /* @__PURE__ */ v(p, {
|
|
328
340
|
variant: "outline",
|
|
329
341
|
className: "h-11 w-full rounded-xl gap-2",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ _("span", { children: u("go_to_checkout") }), /* @__PURE__ */ _(S, {
|
|
331
343
|
className: "h-4 w-4",
|
|
332
344
|
"aria-hidden": "true"
|
|
333
345
|
})]
|
|
@@ -342,4 +354,4 @@ function E() {
|
|
|
342
354
|
});
|
|
343
355
|
}
|
|
344
356
|
//#endregion
|
|
345
|
-
export {
|
|
357
|
+
export { T as default };
|
|
@@ -143,7 +143,7 @@ function s({ estimatedTotalLabel: s, couponCode: c, discountAmountLabel: l, tota
|
|
|
143
143
|
type: "button",
|
|
144
144
|
variant: S === t.id ? "default" : "outline",
|
|
145
145
|
disabled: C,
|
|
146
|
-
className: "h-9
|
|
146
|
+
className: "h-9 px-4 text-xs",
|
|
147
147
|
onClick: () => {
|
|
148
148
|
w(t.id);
|
|
149
149
|
},
|