@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,14 +1,14 @@
|
|
|
1
1
|
import { Button as e } from "../ui/button.js";
|
|
2
2
|
import { normalizeStorefrontI18nLanguage as t } from "../i18n/I18nProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { toast as n } from "../lib/toast.js";
|
|
4
|
+
import { Card as r } from "../ui/card.js";
|
|
5
|
+
import { ContractSaleDocument as i } from "../components/ContractSaleDocument/Invoice.js";
|
|
5
6
|
import "../components/ContractSaleDocument/index.js";
|
|
6
|
-
import { apiGet as
|
|
7
|
-
import { Spinner as
|
|
8
|
-
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { toast as _ } from "@rpcbase/client";
|
|
7
|
+
import { apiGet as a, apiPost as o } from "../lib/apiCall.js";
|
|
8
|
+
import { Spinner as s } from "../chunks/pkg/ui/dist/Spinner/index-Cgi70z_E.js";
|
|
9
|
+
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as c, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as l, GET_CONTRACT_SALE_DOCUMENT_ROUTE as u, acceptContractSaleDocumentResponseSchema as d, contractSaleDocumentApiSchema as f, getContractSaleDocumentResponseSchema as p } from "../lib/contractSaleDocumentApi.js";
|
|
10
|
+
import { useEffect as m, useState as h } from "react";
|
|
11
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
12
|
import { Link as v, useLoaderData as y, useLocation as b, useNavigate as x } from "@rpcbase/router";
|
|
13
13
|
import { useTranslation as S } from "react-i18next";
|
|
14
14
|
import { cn as C } from "@rpcbase/ui";
|
|
@@ -21,7 +21,7 @@ var O = (e) => new URLSearchParams(e).get("pdf") === "1", k = (e) => t(new URLSe
|
|
|
21
21
|
}, j = (e) => {
|
|
22
22
|
let t = typeof e?.req?.originalUrl == "string" ? e.req.originalUrl : "";
|
|
23
23
|
return t ? k(new URL(t, "http://localhost").search) : typeof window < "u" ? k(window.location.search) : null;
|
|
24
|
-
}, M = (e, t, n, r) => `${
|
|
24
|
+
}, M = (e, t, n, r) => `${l}?${new URLSearchParams({
|
|
25
25
|
storeSlug: e,
|
|
26
26
|
referenceId: t,
|
|
27
27
|
saleDocumentId: n,
|
|
@@ -40,7 +40,7 @@ var O = (e) => new URLSearchParams(e).get("pdf") === "1", k = (e) => t(new URLSe
|
|
|
40
40
|
return i;
|
|
41
41
|
}
|
|
42
42
|
return e.match(/filename="([^"]+)"/i)?.[1] ?? e.match(/filename=([^;]+)/i)?.[1]?.trim() ?? r;
|
|
43
|
-
}, F = (e) => /* @__PURE__ */
|
|
43
|
+
}, F = (e) => /* @__PURE__ */ g(s, {
|
|
44
44
|
className: "size-4",
|
|
45
45
|
"aria-hidden": "true",
|
|
46
46
|
"data-testid": e
|
|
@@ -55,25 +55,25 @@ var O = (e) => new URLSearchParams(e).get("pdf") === "1", k = (e) => t(new URLSe
|
|
|
55
55
|
labelKey: "docs_contract_sale_language_option_fr"
|
|
56
56
|
};
|
|
57
57
|
function R({ selectedLanguage: t, onChange: n }) {
|
|
58
|
-
let { t: r } = S(), [i, a] =
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
let { t: r } = S(), [i, a] = h(!1), o = I.find((e) => e.code === t) ?? L;
|
|
59
|
+
return /* @__PURE__ */ _(D.Root, {
|
|
60
60
|
open: i,
|
|
61
61
|
onOpenChange: a,
|
|
62
|
-
children: [/* @__PURE__ */
|
|
62
|
+
children: [/* @__PURE__ */ g(D.Trigger, {
|
|
63
63
|
nativeButton: !0,
|
|
64
|
-
render: /* @__PURE__ */
|
|
64
|
+
render: /* @__PURE__ */ _(e, {
|
|
65
65
|
variant: "outline",
|
|
66
66
|
size: "sm",
|
|
67
67
|
type: "button",
|
|
68
68
|
"aria-label": r("docs_contract_sale_language_selector_label"),
|
|
69
69
|
className: "h-9 gap-1 bg-background/80 px-2 uppercase",
|
|
70
70
|
"data-testid": "contract-sale-document-language-trigger",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ g("span", { children: o.code }), /* @__PURE__ */ g(T, {
|
|
72
72
|
className: "h-4 w-4",
|
|
73
73
|
"aria-hidden": "true"
|
|
74
74
|
})]
|
|
75
75
|
})
|
|
76
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ g(D.Portal, { children: /* @__PURE__ */ g(D.Positioner, {
|
|
77
77
|
align: "end",
|
|
78
78
|
sideOffset: 4,
|
|
79
79
|
positionMethod: "fixed",
|
|
@@ -84,20 +84,20 @@ function R({ selectedLanguage: t, onChange: n }) {
|
|
|
84
84
|
align: "shift",
|
|
85
85
|
fallbackAxisSide: "none"
|
|
86
86
|
},
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
render: (e, t) => /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ g(D.Popup, {
|
|
88
|
+
render: (e, t) => /* @__PURE__ */ g("div", {
|
|
89
89
|
...e,
|
|
90
90
|
"data-menu-content": "",
|
|
91
91
|
"data-state": t.open ? "open" : "closed"
|
|
92
92
|
}),
|
|
93
93
|
className: "z-50 min-w-36 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md transition-opacity duration-75 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[instant]:transition-none",
|
|
94
|
-
children: I.map((e) => /* @__PURE__ */
|
|
94
|
+
children: I.map((e) => /* @__PURE__ */ _(D.Item, {
|
|
95
95
|
onClick: (t) => {
|
|
96
96
|
t.defaultPrevented || (n(e.code), a(!1));
|
|
97
97
|
},
|
|
98
98
|
"data-testid": `contract-sale-document-language-option-${e.code}`,
|
|
99
99
|
className: C("relative flex cursor-pointer select-none items-center justify-between gap-3 whitespace-nowrap rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground", t === e.code && "bg-accent"),
|
|
100
|
-
children: [/* @__PURE__ */
|
|
100
|
+
children: [/* @__PURE__ */ g("span", { children: r(e.labelKey) }), /* @__PURE__ */ g("span", {
|
|
101
101
|
className: "text-2xs uppercase text-muted-foreground",
|
|
102
102
|
children: e.code
|
|
103
103
|
})]
|
|
@@ -107,27 +107,27 @@ function R({ selectedLanguage: t, onChange: n }) {
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
var z = (async ({ ctx: e, params: t }) => {
|
|
110
|
-
let n = typeof t.storeSlug == "string" ? t.storeSlug.trim().toLowerCase() : "", r = typeof t.referenceId == "string" ? t.referenceId.trim() : "",
|
|
111
|
-
if (!n || !r || !
|
|
110
|
+
let n = typeof t.storeSlug == "string" ? t.storeSlug.trim().toLowerCase() : "", r = typeof t.referenceId == "string" ? t.referenceId.trim() : "", i = typeof t.saleDocumentId == "string" ? t.saleDocumentId.trim() : "", o = A(e), s = j(e);
|
|
111
|
+
if (!n || !r || !i) return {
|
|
112
112
|
storeSlug: n,
|
|
113
113
|
referenceId: r,
|
|
114
|
-
saleDocumentId:
|
|
114
|
+
saleDocumentId: i,
|
|
115
115
|
pdfMode: o,
|
|
116
116
|
documentLanguage: s,
|
|
117
117
|
document: null,
|
|
118
118
|
error: null
|
|
119
119
|
};
|
|
120
120
|
try {
|
|
121
|
-
let t = await
|
|
121
|
+
let t = await a(u, {
|
|
122
122
|
storeSlug: n,
|
|
123
123
|
referenceId: r,
|
|
124
|
-
saleDocumentId:
|
|
124
|
+
saleDocumentId: i,
|
|
125
125
|
...s ? { lang: s } : {}
|
|
126
|
-
}, e), c =
|
|
126
|
+
}, e), c = p.parse(t);
|
|
127
127
|
return !c.success || !c.document ? {
|
|
128
128
|
storeSlug: n,
|
|
129
129
|
referenceId: r,
|
|
130
|
-
saleDocumentId:
|
|
130
|
+
saleDocumentId: i,
|
|
131
131
|
pdfMode: o,
|
|
132
132
|
documentLanguage: s,
|
|
133
133
|
document: null,
|
|
@@ -135,7 +135,7 @@ var z = (async ({ ctx: e, params: t }) => {
|
|
|
135
135
|
} : {
|
|
136
136
|
storeSlug: n,
|
|
137
137
|
referenceId: r,
|
|
138
|
-
saleDocumentId:
|
|
138
|
+
saleDocumentId: i,
|
|
139
139
|
pdfMode: o,
|
|
140
140
|
documentLanguage: s,
|
|
141
141
|
document: c.document,
|
|
@@ -145,7 +145,7 @@ var z = (async ({ ctx: e, params: t }) => {
|
|
|
145
145
|
return console.error("Failed to load storefront contract sale document", e), {
|
|
146
146
|
storeSlug: n,
|
|
147
147
|
referenceId: r,
|
|
148
|
-
saleDocumentId:
|
|
148
|
+
saleDocumentId: i,
|
|
149
149
|
pdfMode: o,
|
|
150
150
|
documentLanguage: s,
|
|
151
151
|
document: null,
|
|
@@ -153,56 +153,56 @@ var z = (async ({ ctx: e, params: t }) => {
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
}), B = (e) => {
|
|
156
|
-
let t =
|
|
156
|
+
let t = f.safeParse(e);
|
|
157
157
|
return t.success ? t.data : null;
|
|
158
158
|
};
|
|
159
159
|
function V() {
|
|
160
|
-
let { t:
|
|
161
|
-
|
|
162
|
-
j(B(
|
|
163
|
-
}, [
|
|
164
|
-
t(
|
|
165
|
-
}, [
|
|
160
|
+
let { t: a, i18n: s } = S(), l = y(), u = b(), f = x(), { storeSlug: p, referenceId: C, saleDocumentId: T } = l, D = l.pdfMode || O(u.search), [A, j] = h(B(l.document)), [I, L] = h(null), [z, V] = h(!1), [H, U] = h(l.error), W = k(u.search) ?? t(A?.language?.customer) ?? l.documentLanguage ?? t(s.language) ?? "fr", G = p && C && T ? M(p, C, T, W) : null, K = p && C && T ? N(p, C, T, W) : "";
|
|
161
|
+
m(() => {
|
|
162
|
+
j(B(l.document)), U(l.error);
|
|
163
|
+
}, [l.document, l.error]), m(() => {
|
|
164
|
+
t(s.language) !== W && s.changeLanguage(W);
|
|
165
|
+
}, [s, W]);
|
|
166
166
|
let q = (e) => {
|
|
167
167
|
if (e === W) return;
|
|
168
|
-
|
|
169
|
-
let t = new URLSearchParams(
|
|
168
|
+
s.changeLanguage(e);
|
|
169
|
+
let t = new URLSearchParams(u.search);
|
|
170
170
|
t.set("lang", e);
|
|
171
171
|
let n = t.toString();
|
|
172
|
-
|
|
172
|
+
f(`${u.pathname}${n ? `?${n}` : ""}${u.hash || ""}`, { replace: !0 });
|
|
173
173
|
};
|
|
174
|
-
if (!A) return /* @__PURE__ */
|
|
174
|
+
if (!A) return /* @__PURE__ */ g("div", {
|
|
175
175
|
className: "mx-auto max-w-3xl px-4 py-14 sm:px-6",
|
|
176
|
-
children: /* @__PURE__ */
|
|
176
|
+
children: /* @__PURE__ */ g(r, {
|
|
177
177
|
className: "border-slate-200 bg-white p-5 shadow-sm sm:p-6",
|
|
178
|
-
children: /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ _("div", {
|
|
179
179
|
className: "space-y-4",
|
|
180
180
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ g("h1", {
|
|
182
182
|
className: "text-lg font-semibold text-slate-950",
|
|
183
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ g("span", { children: a("docs_contract_sale_not_found_title") })
|
|
184
184
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ g("p", {
|
|
186
186
|
className: "text-sm text-destructive",
|
|
187
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ g("span", { children: H ?? a("docs_contract_sale_load_error") })
|
|
188
188
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
to: `/${
|
|
191
|
-
children: /* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ g(v, {
|
|
190
|
+
to: `/${p ?? ""}`,
|
|
191
|
+
children: /* @__PURE__ */ _(e, {
|
|
192
192
|
className: "gap-2",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ g(w, {
|
|
194
194
|
className: "h-4 w-4",
|
|
195
195
|
"aria-hidden": "true"
|
|
196
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ g("span", { children: a("docs_contract_sale_back_to_storefront") })]
|
|
197
197
|
})
|
|
198
198
|
})
|
|
199
199
|
]
|
|
200
200
|
})
|
|
201
201
|
})
|
|
202
202
|
});
|
|
203
|
-
if (D) return /* @__PURE__ */
|
|
203
|
+
if (D) return /* @__PURE__ */ g("div", {
|
|
204
204
|
className: "min-h-screen bg-white",
|
|
205
|
-
children: /* @__PURE__ */
|
|
205
|
+
children: /* @__PURE__ */ g(i, {
|
|
206
206
|
data: A,
|
|
207
207
|
renderMode: "pdf",
|
|
208
208
|
publicDocumentUrl: K
|
|
@@ -211,52 +211,52 @@ function V() {
|
|
|
211
211
|
let J = async () => {
|
|
212
212
|
if (!G || z) return;
|
|
213
213
|
V(!0);
|
|
214
|
-
let e =
|
|
214
|
+
let e = n.loading(a("docs_contract_sale_preparing_pdf"), { icon: F() });
|
|
215
215
|
try {
|
|
216
216
|
let t = await fetch(G, {
|
|
217
217
|
method: "GET",
|
|
218
218
|
credentials: "include"
|
|
219
219
|
});
|
|
220
220
|
if (!t.ok) throw Error(`PDF request failed with status ${t.status}`);
|
|
221
|
-
let
|
|
222
|
-
|
|
223
|
-
window.URL.revokeObjectURL(
|
|
221
|
+
let r = await t.blob(), i = window.URL.createObjectURL(r), a = window.document.createElement("a");
|
|
222
|
+
a.href = i, a.download = P(t.headers.get("content-disposition"), A.saleDocumentNumber, A.kind), window.document.body.appendChild(a), a.click(), a.remove(), n.dismiss(e), window.setTimeout(() => {
|
|
223
|
+
window.URL.revokeObjectURL(i);
|
|
224
224
|
}, 0);
|
|
225
225
|
} catch (t) {
|
|
226
|
-
console.error("Failed to download storefront contract sale document PDF", t),
|
|
226
|
+
console.error("Failed to download storefront contract sale document PDF", t), n.dismiss(e), n.error(a("docs_contract_sale_download_pdf_error"));
|
|
227
227
|
} finally {
|
|
228
228
|
V(!1);
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ _("div", {
|
|
232
232
|
className: "flex h-dvh min-h-0 flex-col overflow-hidden bg-gradient-to-br from-slate-100 via-slate-100 to-slate-200",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ _("div", {
|
|
234
234
|
className: "fixed inset-x-0 top-0 z-40 flex h-14 items-center justify-between gap-3 border-b border-border bg-background/70 px-4 backdrop-blur-xl backdrop-saturate-125 supports-[backdrop-filter]:bg-background/55 sm:px-6",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
236
|
-
to: `/${
|
|
235
|
+
children: [/* @__PURE__ */ _(v, {
|
|
236
|
+
to: `/${p ?? ""}`,
|
|
237
237
|
className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ g(w, {
|
|
239
239
|
className: "h-4 w-4",
|
|
240
240
|
"aria-hidden": "true"
|
|
241
|
-
}), /* @__PURE__ */
|
|
242
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ g("span", { children: a("docs_contract_sale_back_to_storefront") })]
|
|
242
|
+
}), /* @__PURE__ */ _("div", {
|
|
243
243
|
className: "flex min-w-0 items-center gap-2",
|
|
244
244
|
children: [
|
|
245
|
-
H ? /* @__PURE__ */
|
|
245
|
+
H ? /* @__PURE__ */ g("span", {
|
|
246
246
|
className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-destructive",
|
|
247
247
|
children: H
|
|
248
|
-
}) : I === "signature" ? /* @__PURE__ */
|
|
248
|
+
}) : I === "signature" ? /* @__PURE__ */ g("span", {
|
|
249
249
|
className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-slate-600",
|
|
250
|
-
children:
|
|
251
|
-
}) : I === "acceptance" ? /* @__PURE__ */
|
|
250
|
+
children: a("docs_contract_sale_submitting_signature")
|
|
251
|
+
}) : I === "acceptance" ? /* @__PURE__ */ g("span", {
|
|
252
252
|
className: "max-w-[min(44vw,24rem)] truncate text-right text-sm text-slate-600",
|
|
253
|
-
children:
|
|
253
|
+
children: a("docs_contract_sale_submitting_acceptance")
|
|
254
254
|
}) : null,
|
|
255
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ g(R, {
|
|
256
256
|
selectedLanguage: W,
|
|
257
257
|
onChange: q
|
|
258
258
|
}),
|
|
259
|
-
G ? /* @__PURE__ */
|
|
259
|
+
G ? /* @__PURE__ */ _(e, {
|
|
260
260
|
variant: "outline",
|
|
261
261
|
size: "sm",
|
|
262
262
|
type: "button",
|
|
@@ -267,15 +267,15 @@ function V() {
|
|
|
267
267
|
className: "h-9 bg-background/80 px-3",
|
|
268
268
|
"data-testid": "contract-sale-document-download-pdf",
|
|
269
269
|
children: [
|
|
270
|
-
z ? F("contract-sale-document-download-spinner") : /* @__PURE__ */
|
|
270
|
+
z ? F("contract-sale-document-download-spinner") : /* @__PURE__ */ g(E, {
|
|
271
271
|
className: "h-4 w-4",
|
|
272
272
|
"aria-hidden": "true"
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ g("span", {
|
|
275
275
|
className: "hidden sm:inline",
|
|
276
|
-
children:
|
|
276
|
+
children: a("docs_contract_sale_download_pdf")
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ g("span", {
|
|
279
279
|
className: "sm:hidden",
|
|
280
280
|
children: "PDF"
|
|
281
281
|
})
|
|
@@ -283,19 +283,19 @@ function V() {
|
|
|
283
283
|
}) : null
|
|
284
284
|
]
|
|
285
285
|
})]
|
|
286
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ g("div", {
|
|
287
287
|
className: "min-h-0 flex-1",
|
|
288
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ g(i, {
|
|
289
289
|
data: A,
|
|
290
290
|
heightMode: "parent",
|
|
291
291
|
publicDocumentUrl: K,
|
|
292
292
|
onAccept: async (e) => {
|
|
293
|
-
let t = e.mode === "signature" ?
|
|
294
|
-
if (!
|
|
293
|
+
let t = e.mode === "signature" ? a("docs_contract_sale_signature_submit_error") : a("docs_contract_sale_acceptance_submit_error");
|
|
294
|
+
if (!p || !C || !T) throw Error(t);
|
|
295
295
|
L(e.mode);
|
|
296
296
|
try {
|
|
297
|
-
let n = await
|
|
298
|
-
storeSlug:
|
|
297
|
+
let n = await o(c, {
|
|
298
|
+
storeSlug: p,
|
|
299
299
|
referenceId: C,
|
|
300
300
|
saleDocumentId: T,
|
|
301
301
|
lang: W,
|
|
@@ -305,7 +305,7 @@ function V() {
|
|
|
305
305
|
phone: e.phone,
|
|
306
306
|
signature: e.signature
|
|
307
307
|
} : { mode: "acceptance" }
|
|
308
|
-
}), r =
|
|
308
|
+
}), r = d.parse(n);
|
|
309
309
|
if (!r.success) {
|
|
310
310
|
let e = r.message ?? t;
|
|
311
311
|
if (r.document) return j(r.document), U(e), r.document;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage.d.ts","sourceRoot":"","sources":["../../src/pages/ErrorPage.tsx"],"names":[],"mappings":"AA4HA,MAAM,CAAC,OAAO,UAAU,SAAS,
|
|
1
|
+
{"version":3,"file":"ErrorPage.d.ts","sourceRoot":"","sources":["../../src/pages/ErrorPage.tsx"],"names":[],"mappings":"AA4HA,MAAM,CAAC,OAAO,UAAU,SAAS,4CA+EhC"}
|
package/dist/pages/ErrorPage.js
CHANGED
|
@@ -43,8 +43,8 @@ function _(e) {
|
|
|
43
43
|
description: "store_unavailable_description"
|
|
44
44
|
};
|
|
45
45
|
case "unknown": return {
|
|
46
|
-
title: "
|
|
47
|
-
description: "
|
|
46
|
+
title: "generic_not_found_title",
|
|
47
|
+
description: "generic_not_found_description"
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -52,14 +52,14 @@ function v(e) {
|
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
54
|
function y() {
|
|
55
|
-
let { t: e } = c(), { storeSlug: a } = o(), f = s(), p = h(f), m = p === 404, y = g(f, p), b = y !== null, x = v(f),
|
|
55
|
+
let { t: e } = c(), { storeSlug: a } = o(), f = s(), p = h(f), m = p === 404, y = g(f, p), b = y !== null, x = y !== null && y.status !== "unknown", S = v(f), C = y ? _(y.status) : null, w = C?.title ?? (m ? "not_found_title" : "error_title"), T = C?.description ?? (m ? "not_found_description" : "error_description"), E = y?.status === "moved" ? y.replacementSlug : void 0, D = x ? E ? `/${encodeURIComponent(E)}` : null : y?.status === "unknown" ? null : `/${a ?? ""}`, O = E ? "go_to_moved_storefront" : "back_to_home";
|
|
56
56
|
return t(() => {
|
|
57
57
|
document.documentElement.setAttribute("data-hydrated", "true"), b && document.querySelectorAll("vite-error-overlay").forEach((e) => {
|
|
58
58
|
e.remove();
|
|
59
|
-
}), m || (console.error(f), console.error(
|
|
59
|
+
}), m || (console.error(f), console.error(S));
|
|
60
60
|
}, [
|
|
61
61
|
f,
|
|
62
|
-
|
|
62
|
+
S,
|
|
63
63
|
m,
|
|
64
64
|
b
|
|
65
65
|
]), /* @__PURE__ */ n("div", {
|
|
@@ -79,27 +79,27 @@ function y() {
|
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ n("h1", {
|
|
81
81
|
className: "text-2xl font-semibold tracking-tight",
|
|
82
|
-
children: /* @__PURE__ */ n("span", { children: e(
|
|
82
|
+
children: /* @__PURE__ */ n("span", { children: e(w) })
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ n("p", {
|
|
85
85
|
className: "text-muted-foreground",
|
|
86
|
-
children: /* @__PURE__ */ n("span", { children: e(
|
|
86
|
+
children: /* @__PURE__ */ n("span", { children: e(T, { store: a }) })
|
|
87
87
|
}),
|
|
88
|
-
|
|
88
|
+
x ? /* @__PURE__ */ n("p", {
|
|
89
89
|
className: "text-sm text-muted-foreground",
|
|
90
90
|
children: /* @__PURE__ */ n("span", { children: e("store_unavailable_contact") })
|
|
91
91
|
}) : null
|
|
92
92
|
]
|
|
93
93
|
}),
|
|
94
|
-
|
|
94
|
+
D ? /* @__PURE__ */ n("div", {
|
|
95
95
|
className: "flex justify-center",
|
|
96
96
|
children: /* @__PURE__ */ r(i, {
|
|
97
|
-
to:
|
|
98
|
-
className: "inline-flex items-center gap-2 rounded-
|
|
99
|
-
children: [n(
|
|
97
|
+
to: D,
|
|
98
|
+
className: "inline-flex items-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
99
|
+
children: [n(E ? d : u, {
|
|
100
100
|
className: "h-4 w-4",
|
|
101
101
|
"aria-hidden": "true"
|
|
102
|
-
}), /* @__PURE__ */ n("span", { children: e(
|
|
102
|
+
}), /* @__PURE__ */ n("span", { children: e(O) })]
|
|
103
103
|
})
|
|
104
104
|
}) : null
|
|
105
105
|
]
|
package/dist/pages/HomePage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BOOKING_SEARCH_KEYS as e, applyBookingParamsToSearch as t, createBookingPeriodConfigFromStorefrontConfiguration as n, getBookingParamsFromSearch as r, getDefaultBookingParamsForStorefrontConfiguration as i, resolveBookingSearchParamsFromSessionStorage as a, writeBookingSearchParamsToSessionStorage as o } from "../lib/booking.js";
|
|
2
|
-
import { getAvailabilityVariant as ee } from "../lib/utils.js";
|
|
3
2
|
import { getLocalizedValue as s } from "../localization.js";
|
|
3
|
+
import { getAvailabilityVariant as ee } from "../lib/utils.js";
|
|
4
4
|
import { buildStorefrontImageUrl as c } from "../lib/storefrontImage.js";
|
|
5
5
|
import "../lib/storefrontMissingValues.js";
|
|
6
6
|
import { Badge as l } from "../ui/badge.js";
|
|
@@ -14,7 +14,7 @@ import { BookingEndTimeField as oe } from "../components/BookingPeriodSelector/c
|
|
|
14
14
|
import { BookingTimeSlotsStatus as se } from "../components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js";
|
|
15
15
|
import "../components/BookingPeriodSelector/index.js";
|
|
16
16
|
import { DeliveryAddressSelector as ce } from "../components/DeliveryAddressSelector/index.js";
|
|
17
|
-
import { useStorefront as le, useStorefrontProducts as ue } from "../
|
|
17
|
+
import { useStorefront as le, useStorefrontProducts as ue } from "../StorefrontContext.js";
|
|
18
18
|
import { ContactSection as de } from "../components/ContactSection/index.js";
|
|
19
19
|
import { TestimonialsSection as fe } from "../components/TestimonialsSection/index.js";
|
|
20
20
|
import { AboutSection as pe } from "../components/AboutSection/index.js";
|
|
@@ -639,7 +639,10 @@ function O() {
|
|
|
639
639
|
}),
|
|
640
640
|
/* @__PURE__ */ _("div", {
|
|
641
641
|
className: "flex items-center justify-between gap-2",
|
|
642
|
-
children: /* @__PURE__ */ _(ge, {
|
|
642
|
+
children: /* @__PURE__ */ _(ge, {
|
|
643
|
+
prices: e.prices,
|
|
644
|
+
openOnHover: !1
|
|
645
|
+
})
|
|
643
646
|
})
|
|
644
647
|
]
|
|
645
648
|
}, e.id);
|
|
@@ -31,7 +31,7 @@ function s() {
|
|
|
31
31
|
className: "flex justify-center",
|
|
32
32
|
children: /* @__PURE__ */ t(n, {
|
|
33
33
|
to: `/${c ?? ""}`,
|
|
34
|
-
className: "inline-flex items-center gap-2 rounded-
|
|
34
|
+
className: "inline-flex items-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
35
35
|
children: [/* @__PURE__ */ e(o, {
|
|
36
36
|
className: "h-4 w-4",
|
|
37
37
|
"aria-hidden": "true"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductPage.d.ts","sourceRoot":"","sources":["../../src/pages/ProductPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductPage.d.ts","sourceRoot":"","sources":["../../src/pages/ProductPage.tsx"],"names":[],"mappings":"AA+HA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAqXlC"}
|