@loczer/storefront-sdk 0.194.0 → 0.196.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/chunks/pkg/ui/dist/{Button-CxG2fSpA.js → Button-Cr_u8vnh.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Dialog-4leTWiev.js → Dialog-CczmPDwY.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Drawer/{index-DA5V7R_q.js → index-CSvSVP_J.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Map/{MapContent-BmKjdWmq.js → MapContent-CDeWtwKa.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Map-CsOTdTtL.js → Map-Cs7wgtH9.js} +2 -2
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-CfEqkJ0y.js → MorphingModalWizard-j1CgFGLe.js} +4 -3
- package/dist/chunks/pkg/ui/dist/{ResponsiveDialog-C6IWYoIg.js → ResponsiveDialog-BVwhTZQo.js} +3 -3
- package/dist/chunks/pkg/ui/dist/{ScrollArea-Bjwo84cv.js → ScrollArea-BqLd0xZj.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Spinner/{index-DzMEU0iA.js → index-Cgi70z_E.js} +1 -1
- package/dist/chunks/pkg/ui/dist/lib/utils-DXB19bzk.js +8 -0
- package/dist/components/BikeProductCard/index.js +6 -6
- package/dist/components/BookingBikeVariantDialog/index.js +7 -7
- package/dist/components/BookingFlowSteps/index.js +11 -11
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +16 -15
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +16 -15
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +20 -23
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +39 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +830 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +52 -46
- package/dist/components/ContactSection/index.js +35 -35
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +4 -4
- package/dist/components/ContractSaleDocument/ThumbnailSidebar.js +1 -1
- package/dist/components/DeliveryAddressSelector/index.js +5 -5
- package/dist/components/Footer/index.js +11 -11
- package/dist/components/FulfillmentSection/index.js +9 -9
- package/dist/components/Header/index.js +61 -61
- package/dist/components/Map/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +5 -5
- package/dist/components/ProductPriceBadge/index.js +73 -73
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +6 -6
- package/dist/components/StorefrontCartPanel/index.js +8 -8
- package/dist/components/StorefrontInsuranceNotice/index.js +6 -6
- package/dist/components/StorefrontPopupMessages/index.js +8 -8
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/lib/utils.d.ts +3 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +9 -5
- package/dist/pages/BookingPage.js +8 -8
- package/dist/pages/CheckoutPaymentPage.js +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +15 -15
- package/dist/pages/HomePage.js +19 -19
- package/dist/pages/PaymentLinkPage.js +1 -1
- package/dist/pages/PaymentLinkSuccessPage.js +1 -1
- package/dist/pages/ProductPage.js +143 -143
- package/dist/pages/checkout/components/CheckoutCouponCard.js +5 -5
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
- package/dist/storefront.css +1 -1
- package/package.json +5 -1
- package/dist/chunks/node_modules/clsx/dist/clsx-CdyIqUTr.js +0 -16
- package/dist/chunks/node_modules/tailwind-merge/dist/bundle-mjs-CF4QheV5.js +0 -1608
- package/dist/chunks/pkg/ui/dist/lib/utils-BN5KOMSm.js +0 -8
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts +0 -22
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +0 -1
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.js +0 -342
|
@@ -5,29 +5,29 @@ import { useStorefrontCart as s } from "../lib/cart.js";
|
|
|
5
5
|
import { getAvailabilityVariant as c } from "../lib/utils.js";
|
|
6
6
|
import { getLocalizedValue as l } from "../localization.js";
|
|
7
7
|
import { ROUTE as ee, buildStorefrontAvailabilityKey as u, getStorefrontAvailabilityIssue as d, getStorefrontAvailabilityStatus as f, getValidStorefrontAvailabilitySchedule as te, isStorefrontAvailabilityInsufficient as p, responseSchema as ne } from "../lib/storefrontAvailability.js";
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { Input as
|
|
11
|
-
import { useStorefront as
|
|
12
|
-
import { Card as
|
|
13
|
-
import { ProductWarningNotice as
|
|
14
|
-
import { ProductPriceBadge as
|
|
15
|
-
import { resolveProductImageContainerStyle as
|
|
16
|
-
import { apiPost as
|
|
17
|
-
import { RadioGroup as
|
|
18
|
-
import { useEffect as
|
|
19
|
-
import { jsx as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { ArrowLeft as
|
|
8
|
+
import { Badge as m } from "../ui/badge.js";
|
|
9
|
+
import { Button as h } from "../ui/button.js";
|
|
10
|
+
import { Input as re } from "../ui/input.js";
|
|
11
|
+
import { useStorefront as ie, useStorefrontProducts as ae } from "../StorefrontProvider.js";
|
|
12
|
+
import { Card as oe } from "../ui/card.js";
|
|
13
|
+
import { ProductWarningNotice as se } from "../components/ProductWarningNotice/index.js";
|
|
14
|
+
import { ProductPriceBadge as ce } from "../components/ProductPriceBadge/index.js";
|
|
15
|
+
import { resolveProductImageContainerStyle as le } from "../lib/productImageStyles.js";
|
|
16
|
+
import { apiPost as ue } from "../lib/apiCall.js";
|
|
17
|
+
import { RadioGroup as de, RadioGroupItem as fe } from "../ui/radio-group.js";
|
|
18
|
+
import { useEffect as g, useMemo as _, useState as v } from "react";
|
|
19
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
20
|
+
import { Link as pe, useLocation as me, useNavigate as he, useParams as ge, useSearchParams as _e } from "@rpcbase/router";
|
|
21
|
+
import { useTranslation as ve } from "react-i18next";
|
|
22
|
+
import { cn as x } from "@rpcbase/ui";
|
|
23
|
+
import { ArrowLeft as S, ArrowRight as C, Bike as ye, CheckCircle2 as be } from "lucide-react";
|
|
24
24
|
//#region src/pages/ProductPage.tsx
|
|
25
|
-
var
|
|
25
|
+
var w = (e, t = () => !0) => {
|
|
26
26
|
if (!e) return null;
|
|
27
27
|
if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
|
|
28
28
|
let n = e.productVariants ?? [];
|
|
29
29
|
return n.find((e) => t(e.id))?.id ?? n[0]?.id ?? null;
|
|
30
|
-
},
|
|
30
|
+
}, xe = (e, t) => {
|
|
31
31
|
if (!e) return [];
|
|
32
32
|
let n = o(e), r = /* @__PURE__ */ new Map();
|
|
33
33
|
r.set(u(n), {
|
|
@@ -45,53 +45,53 @@ var C = (e, t = () => !0) => {
|
|
|
45
45
|
productVariantId: i,
|
|
46
46
|
quantity: t
|
|
47
47
|
}), Array.from(r.values());
|
|
48
|
-
},
|
|
48
|
+
}, Se = (e, t) => {
|
|
49
49
|
let n = o(e), r = e.representedVariantId?.trim();
|
|
50
50
|
if (r) {
|
|
51
51
|
let e = t.get(u(n, r));
|
|
52
52
|
if (e) return e;
|
|
53
53
|
}
|
|
54
54
|
return t.get(u(n));
|
|
55
|
-
},
|
|
55
|
+
}, Ce = (e, t, n) => n.get(u(o(e), t)), T = (e, t, n) => {
|
|
56
56
|
let r = d(t);
|
|
57
57
|
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: d, i18n:
|
|
61
|
-
bikes:
|
|
62
|
-
accessories:
|
|
58
|
+
}, we = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
|
|
59
|
+
function E() {
|
|
60
|
+
let { t: d, i18n: E } = ve(), { storeSlug: D, productSlug: O } = ge(), [k] = _e(), Te = me(), Ee = he(), { addItem: De, itemCount: A } = s(), { storefrontConfiguration: Oe } = ie(), j = Oe.workspace?.workspaceLanguage, { bikes: M, accessories: N } = ae(), P = _(() => O ? a(O, {
|
|
61
|
+
bikes: M,
|
|
62
|
+
accessories: N
|
|
63
63
|
}) : null, [
|
|
64
|
+
N,
|
|
64
65
|
M,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
]), P = g(() => t(O, E), [O, E]), F = g(() => e(P, {
|
|
66
|
+
O
|
|
67
|
+
]), F = _(() => t(k, D), [k, D]), I = _(() => e(F, {
|
|
68
68
|
start_time: "",
|
|
69
69
|
end_time: ""
|
|
70
|
-
}), [
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
70
|
+
}), [F]), L = _(() => te(I), [I]), R = F.toString(), z = `/${D ?? ""}/checkout${R ? `?${R}` : ""}`, B = `/${D ?? ""}`, ke = B, V = Te.state, Ae = typeof V?.backTo == "string" && V.backTo.startsWith(B) ? V.backTo : ke, [H, U] = v(1), [W, G] = v(() => w(P)), K = Number.isFinite(H) ? Math.max(1, Math.min(99, Math.floor(H))) : 1, q = _(() => xe(P, K), [K, P]), [je, J] = v([]), [Me, Y] = v(!1);
|
|
71
|
+
g(() => {
|
|
72
|
+
if (U(1), !P) {
|
|
73
|
+
G(null);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
n(
|
|
79
|
-
}, [
|
|
80
|
-
if (!
|
|
76
|
+
G(w(P));
|
|
77
|
+
}, [O, P]), g(() => {
|
|
78
|
+
n(D, F);
|
|
79
|
+
}, [F, D]), g(() => {
|
|
80
|
+
if (!D || q.length === 0) {
|
|
81
81
|
J([]), Y(!1);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
if (!
|
|
84
|
+
if (!L) {
|
|
85
85
|
J([]), Y(!1);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
let e = !1;
|
|
89
89
|
return Y(!0), J([]), (async () => {
|
|
90
90
|
try {
|
|
91
|
-
let t = await
|
|
92
|
-
storeSlug:
|
|
93
|
-
schedule:
|
|
94
|
-
products:
|
|
91
|
+
let t = await ue(ee, {
|
|
92
|
+
storeSlug: D,
|
|
93
|
+
schedule: L,
|
|
94
|
+
products: q
|
|
95
95
|
}), n = ne.parse(t);
|
|
96
96
|
if (e) return;
|
|
97
97
|
J(n.success ? n.availability ?? [] : []);
|
|
@@ -105,185 +105,185 @@ function T() {
|
|
|
105
105
|
e = !0;
|
|
106
106
|
};
|
|
107
107
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
q,
|
|
109
|
+
L,
|
|
110
|
+
I.end_date,
|
|
111
|
+
I.end_time,
|
|
112
|
+
I.start_date,
|
|
113
|
+
I.start_time,
|
|
114
|
+
D
|
|
115
115
|
]);
|
|
116
|
-
let Ne =
|
|
117
|
-
|
|
116
|
+
let Ne = _(() => new Map(je.map((e) => [u(e.productId, e.productVariantId), e])), [je]), Pe = () => {
|
|
117
|
+
Ee(Ae);
|
|
118
118
|
};
|
|
119
|
-
if (!
|
|
119
|
+
if (!P) return /* @__PURE__ */ y("div", {
|
|
120
120
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
121
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ b("div", {
|
|
122
122
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
123
123
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ y("h1", {
|
|
125
125
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ y("span", { children: d("product_not_found_title") })
|
|
127
127
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ y("p", {
|
|
129
129
|
className: "mt-2 text-sm text-slate-600",
|
|
130
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ y("span", { children: d("product_not_found_description") })
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ y("div", {
|
|
133
133
|
className: "mt-6",
|
|
134
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ b(h, {
|
|
135
135
|
type: "button",
|
|
136
136
|
className: "gap-2",
|
|
137
137
|
onClick: Pe,
|
|
138
|
-
children: [/* @__PURE__ */
|
|
138
|
+
children: [/* @__PURE__ */ y(S, {
|
|
139
139
|
className: "h-4 w-4",
|
|
140
140
|
"aria-hidden": "true"
|
|
141
|
-
}), /* @__PURE__ */
|
|
141
|
+
}), /* @__PURE__ */ y("span", { children: d("go_back") })]
|
|
142
142
|
})
|
|
143
143
|
})
|
|
144
144
|
]
|
|
145
145
|
})
|
|
146
146
|
});
|
|
147
|
-
let Fe = l(
|
|
148
|
-
return /* @__PURE__ */
|
|
147
|
+
let Fe = l(P.name, E.language, j), Ie = l(P.description, E.language, j), Le = l(P.warning, E.language, j), X = typeof P.images?.[0] == "string" ? P.images[0].trim() : "", Re = le(P.primaryImageStyle), Z = Se(P, Ne), ze = we(P), Be = Z ? f(Z) : ze, Ve = c(Be), He = Me ? d("availability_checking") : T(d, Z, Be), Q = Z ? p(Z) : ze === "OUT_OF_STOCK", $ = P.productVariants ?? [], Ue = $.some((e) => !!r(e, "size")) ? d("product_size_label") : d("product_variant_label"), We = !!W && L !== null;
|
|
148
|
+
return /* @__PURE__ */ y("div", {
|
|
149
149
|
className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ b("div", {
|
|
151
151
|
className: "flex flex-col gap-6",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ b("div", {
|
|
153
153
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ b(h, {
|
|
155
155
|
type: "button",
|
|
156
156
|
variant: "ghost",
|
|
157
157
|
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
158
|
onClick: Pe,
|
|
159
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ y(S, {
|
|
160
160
|
className: "h-4 w-4",
|
|
161
161
|
"aria-hidden": "true"
|
|
162
|
-
}), /* @__PURE__ */
|
|
163
|
-
}), /* @__PURE__ */
|
|
164
|
-
to:
|
|
165
|
-
className:
|
|
166
|
-
children: /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ y("span", { children: d("go_back") })]
|
|
163
|
+
}), /* @__PURE__ */ y(pe, {
|
|
164
|
+
to: z,
|
|
165
|
+
className: x(A > 0 && L ? "inline-flex" : "hidden"),
|
|
166
|
+
children: /* @__PURE__ */ b(h, {
|
|
167
167
|
size: "sm",
|
|
168
168
|
className: "gap-2",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ y("span", { children: d("checkout_button") }), /* @__PURE__ */ y(C, {
|
|
170
170
|
className: "h-4 w-4",
|
|
171
171
|
"aria-hidden": "true"
|
|
172
172
|
})]
|
|
173
173
|
})
|
|
174
174
|
})]
|
|
175
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ b("div", {
|
|
176
176
|
className: "grid gap-6 lg:grid-cols-12",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ b("div", {
|
|
178
178
|
className: "lg:col-span-7",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
-
className:
|
|
179
|
+
children: [/* @__PURE__ */ y("div", {
|
|
180
|
+
className: x("relative aspect-[1618/1000] overflow-hidden rounded-2xl", Re.className),
|
|
181
181
|
style: Re.style,
|
|
182
|
-
children: X ? /* @__PURE__ */
|
|
182
|
+
children: X ? /* @__PURE__ */ y("img", {
|
|
183
183
|
src: X,
|
|
184
184
|
alt: Fe,
|
|
185
185
|
className: "absolute inset-0 h-full w-full object-contain p-2",
|
|
186
186
|
loading: "lazy"
|
|
187
|
-
}) : /* @__PURE__ */
|
|
187
|
+
}) : /* @__PURE__ */ y("div", {
|
|
188
188
|
className: "absolute inset-0 flex items-center justify-center text-slate-400",
|
|
189
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ y(ye, {
|
|
190
190
|
className: "h-12 w-12",
|
|
191
191
|
"aria-hidden": "true"
|
|
192
192
|
})
|
|
193
193
|
})
|
|
194
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ b("div", {
|
|
195
195
|
className: "mt-5 flex flex-col gap-3",
|
|
196
196
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ b("div", {
|
|
198
198
|
className: "flex flex-wrap items-center gap-2",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ y(m, {
|
|
200
200
|
variant: Ve.variant,
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
}), /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ y("span", { children: He })
|
|
202
|
+
}), /* @__PURE__ */ y(ce, { prices: P.prices })]
|
|
203
203
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ y("h1", {
|
|
205
205
|
className: "text-2xl font-semibold tracking-tight text-slate-950",
|
|
206
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ y("span", { children: Fe })
|
|
207
207
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ y("p", {
|
|
209
209
|
className: "text-sm text-slate-600",
|
|
210
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ y("span", { children: Ie })
|
|
211
211
|
}),
|
|
212
|
-
|
|
212
|
+
P.features?.length ? /* @__PURE__ */ b("div", {
|
|
213
213
|
className: "mt-2 space-y-2",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ y("p", {
|
|
215
215
|
className: "text-sm font-semibold text-slate-950",
|
|
216
|
-
children: /* @__PURE__ */
|
|
217
|
-
}), /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ y("span", { children: d("product_features_title") })
|
|
217
|
+
}), /* @__PURE__ */ y("ul", {
|
|
218
218
|
className: "grid gap-1 text-sm text-slate-700",
|
|
219
|
-
children:
|
|
219
|
+
children: P.features.map((e, t) => /* @__PURE__ */ b("li", {
|
|
220
220
|
className: "inline-flex items-start gap-2",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ y(be, {
|
|
222
222
|
className: "mt-0.5 h-4 w-4 text-success",
|
|
223
223
|
"aria-hidden": "true"
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
-
}, `${
|
|
224
|
+
}), /* @__PURE__ */ y("span", { children: l(e, E.language, j) })]
|
|
225
|
+
}, `${P.id}-${t}`))
|
|
226
226
|
})]
|
|
227
227
|
}) : null,
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ y(se, { warning: Le })
|
|
229
229
|
]
|
|
230
230
|
})]
|
|
231
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ y("div", {
|
|
232
232
|
className: "lg:col-span-5",
|
|
233
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ b(oe, {
|
|
234
234
|
className: "border-slate-200 bg-white shadow-sm",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ b("div", {
|
|
236
236
|
className: "border-b border-slate-200 px-4 py-4",
|
|
237
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ y("p", {
|
|
238
238
|
className: "text-sm font-semibold text-slate-950",
|
|
239
|
-
children: /* @__PURE__ */
|
|
240
|
-
}), /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ y("span", { children: d("add_to_cart_title") })
|
|
240
|
+
}), /* @__PURE__ */ y("p", {
|
|
241
241
|
className: "mt-1 text-xs text-slate-600",
|
|
242
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ y("span", { children: d("add_to_cart_description") })
|
|
243
243
|
})]
|
|
244
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ b("div", {
|
|
245
245
|
className: "grid gap-4 px-4 py-4",
|
|
246
246
|
children: [
|
|
247
|
-
|
|
247
|
+
L ? null : /* @__PURE__ */ y("p", {
|
|
248
248
|
role: "alert",
|
|
249
249
|
className: "text-sm text-destructive",
|
|
250
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ y("span", { children: d("booking_time_slots_required") })
|
|
251
251
|
}),
|
|
252
|
-
$.length > 1 ? /* @__PURE__ */
|
|
252
|
+
$.length > 1 ? /* @__PURE__ */ b("div", {
|
|
253
253
|
className: "grid gap-2",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ y("p", {
|
|
255
255
|
className: "text-xs font-medium text-slate-700",
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
value:
|
|
259
|
-
onValueChange:
|
|
256
|
+
children: /* @__PURE__ */ y("span", { children: Ue })
|
|
257
|
+
}), /* @__PURE__ */ y(de, {
|
|
258
|
+
value: W ?? "",
|
|
259
|
+
onValueChange: G,
|
|
260
260
|
className: "grid gap-2",
|
|
261
261
|
children: $.map((e) => {
|
|
262
|
-
let t = `variant-${
|
|
263
|
-
return /* @__PURE__ */
|
|
262
|
+
let t = `variant-${P.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${P.id}-${e.id}`.toLowerCase(), { label: r, description: a } = i(e), o = Ce(P, e.id, Ne), s = o ? p(o) : Q, c = o ? T(d, o, f(o)) : Q ? d("availability_out_of_stock") : null;
|
|
263
|
+
return /* @__PURE__ */ b("label", {
|
|
264
264
|
htmlFor: t,
|
|
265
265
|
"data-testid": n,
|
|
266
|
-
className:
|
|
267
|
-
children: [/* @__PURE__ */
|
|
266
|
+
className: x("flex items-start gap-3 rounded-xl border p-3 transition", W === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
|
|
267
|
+
children: [/* @__PURE__ */ y(fe, {
|
|
268
268
|
id: t,
|
|
269
269
|
value: e.id,
|
|
270
270
|
className: "mt-1"
|
|
271
|
-
}), /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ b("span", {
|
|
272
272
|
className: "flex flex-1 flex-col gap-0.5",
|
|
273
273
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ y("span", {
|
|
275
275
|
className: "text-sm font-medium text-slate-950",
|
|
276
276
|
children: r
|
|
277
277
|
}),
|
|
278
|
-
a ? /* @__PURE__ */
|
|
278
|
+
a ? /* @__PURE__ */ y("span", {
|
|
279
279
|
className: "text-xs text-slate-600",
|
|
280
280
|
children: a
|
|
281
281
|
}) : null,
|
|
282
|
-
c ? /* @__PURE__ */
|
|
282
|
+
c ? /* @__PURE__ */ y("span", {
|
|
283
283
|
className: "pt-1",
|
|
284
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ y(m, {
|
|
285
285
|
variant: s ? "destructive" : "outline",
|
|
286
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ y("span", { children: c })
|
|
287
287
|
})
|
|
288
288
|
}) : null
|
|
289
289
|
]
|
|
@@ -292,42 +292,42 @@ function T() {
|
|
|
292
292
|
})
|
|
293
293
|
})]
|
|
294
294
|
}) : null,
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ b("div", {
|
|
296
296
|
className: "grid gap-2",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ y("p", {
|
|
298
298
|
className: "text-xs font-medium text-slate-700",
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
-
}), /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ y("span", { children: d("quantity_label") })
|
|
300
|
+
}), /* @__PURE__ */ y(re, {
|
|
301
301
|
type: "number",
|
|
302
302
|
min: 1,
|
|
303
303
|
max: 99,
|
|
304
|
-
value:
|
|
305
|
-
onChange: (e) =>
|
|
304
|
+
value: H,
|
|
305
|
+
onChange: (e) => U(Number(e.target.value))
|
|
306
306
|
})]
|
|
307
307
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ b(h, {
|
|
309
309
|
className: "h-11 rounded-xl text-sm font-semibold gap-2",
|
|
310
310
|
onClick: () => {
|
|
311
|
-
!
|
|
312
|
-
kind:
|
|
313
|
-
productId: o(
|
|
314
|
-
...
|
|
315
|
-
quantity:
|
|
311
|
+
!W || !L || De({
|
|
312
|
+
kind: P.kind,
|
|
313
|
+
productId: o(P),
|
|
314
|
+
...W ? { productVariantId: W } : {},
|
|
315
|
+
quantity: K
|
|
316
316
|
});
|
|
317
317
|
},
|
|
318
318
|
disabled: !We,
|
|
319
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ y("span", { children: d("add_to_cart") }), /* @__PURE__ */ y(C, {
|
|
320
320
|
className: "h-4 w-4",
|
|
321
321
|
"aria-hidden": "true"
|
|
322
322
|
})]
|
|
323
323
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
to:
|
|
326
|
-
className:
|
|
327
|
-
children: /* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ y(pe, {
|
|
325
|
+
to: z,
|
|
326
|
+
className: x(A > 0 && L ? "block" : "hidden"),
|
|
327
|
+
children: /* @__PURE__ */ b(h, {
|
|
328
328
|
variant: "outline",
|
|
329
329
|
className: "h-11 w-full rounded-xl gap-2",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ y("span", { children: d("go_to_checkout") }), /* @__PURE__ */ y(C, {
|
|
331
331
|
className: "h-4 w-4",
|
|
332
332
|
"aria-hidden": "true"
|
|
333
333
|
})]
|
|
@@ -342,4 +342,4 @@ function T() {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
//#endregion
|
|
345
|
-
export {
|
|
345
|
+
export { E as default };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Button as e } from "../../../ui/button.js";
|
|
2
2
|
import { Input as t } from "../../../ui/input.js";
|
|
3
|
-
import { Spinner as n } from "../../../chunks/pkg/ui/dist/Spinner/index-
|
|
3
|
+
import { Spinner as n } from "../../../chunks/pkg/ui/dist/Spinner/index-Cgi70z_E.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useTranslation as a } from "react-i18next";
|
|
6
|
+
import { cn as o } from "@rpcbase/ui";
|
|
7
7
|
import { Tag as s, X as c } from "lucide-react";
|
|
8
8
|
//#region src/pages/checkout/components/CheckoutCouponCard.tsx
|
|
9
9
|
function l({ className: l, code: u, appliedCode: d, discountLabel: f, message: p, error: m, loading: h, disabled: g, onCodeChange: _, onApply: v, onRemove: y }) {
|
|
10
|
-
let { t: b } =
|
|
10
|
+
let { t: b } = a(), x = u.trim().length > 0 && !h && !g;
|
|
11
11
|
return /* @__PURE__ */ i("div", {
|
|
12
|
-
className:
|
|
12
|
+
className: o("grid gap-3 border-t border-slate-200 pt-3", l),
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ i("div", {
|
|
15
15
|
className: "flex items-center gap-2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button as e } from "../../../ui/button.js";
|
|
2
2
|
import { Card as t } from "../../../ui/card.js";
|
|
3
|
-
import { Spinner as n } from "../../../chunks/pkg/ui/dist/Spinner/index-
|
|
3
|
+
import { Spinner as n } from "../../../chunks/pkg/ui/dist/Spinner/index-Cgi70z_E.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { useTranslation as a } from "react-i18next";
|
|
6
6
|
import { AlertTriangle as o } from "lucide-react";
|