@loczer/storefront-sdk 0.164.0 → 0.165.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/StorefrontProvider.d.ts +29 -3
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +64 -55
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
- package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
- package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
- package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
- package/dist/components/AboutSection/index.js +1 -1
- 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 +59 -41
- package/dist/components/BookingBikeVariantDialog/index.js +1 -1
- package/dist/components/BookingFlowSteps/index.js +8 -8
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +28 -28
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
- package/dist/components/ContactSection/index.js +4 -4
- package/dist/components/Header/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.js +1 -1
- package/dist/components/ProductWarningNotice/index.js +10 -10
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +13 -13
- package/dist/i18n/en.d.ts +12 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/fr.d.ts +12 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +12 -0
- package/dist/index.d.ts +116 -7
- package/dist/index.js +312 -305
- package/dist/lib/cart.js +1 -1
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +28 -28
- package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +14 -6
- package/dist/lib/checkoutPaymentSession.d.ts +1 -0
- package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentSession.js +12 -11
- package/dist/lib/checkoutSubmit.js +4 -4
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +34 -15
- package/dist/lib/products.d.ts +4 -0
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +74 -39
- package/dist/lib/securePaymentLink.d.ts +1 -0
- package/dist/lib/securePaymentLink.d.ts.map +1 -1
- package/dist/lib/securePaymentLink.js +1 -0
- package/dist/lib/storefrontAvailability.d.ts +9 -0
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +28 -18
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +290 -289
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +224 -216
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +92 -92
- package/dist/pages/ContractSaleDocumentPage.js +3 -3
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +167 -161
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkPage.js +62 -62
- package/dist/pages/PaymentLinkSuccessPage.js +7 -7
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +161 -161
- package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +4 -4
- package/dist/ui/day-picker.js +5 -5
- package/package.json +2 -2
- package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
- package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash-h54_qXon.js +0 -4
|
@@ -6,6 +6,8 @@ type StorefrontContextValue = {
|
|
|
6
6
|
storefrontConfiguration: StorefrontConfiguration;
|
|
7
7
|
bikes: BikeProduct[];
|
|
8
8
|
accessories: AccessoryProduct[];
|
|
9
|
+
bookingBikes: BikeProduct[];
|
|
10
|
+
bookingAccessories: AccessoryProduct[];
|
|
9
11
|
mapboxToken?: string;
|
|
10
12
|
language: StorefrontI18nLanguage;
|
|
11
13
|
};
|
|
@@ -72,8 +74,14 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
|
|
|
72
74
|
percentage: number;
|
|
73
75
|
optimizeDepositAmount: boolean;
|
|
74
76
|
};
|
|
77
|
+
cancellationPolicy: {
|
|
78
|
+
tiers: {
|
|
79
|
+
upToHours: number;
|
|
80
|
+
refundPercentage: number;
|
|
81
|
+
}[];
|
|
82
|
+
};
|
|
75
83
|
securityDeposit: {
|
|
76
|
-
mode: "optional" | "
|
|
84
|
+
mode: "optional" | "disabled" | "required";
|
|
77
85
|
};
|
|
78
86
|
shop: {
|
|
79
87
|
timeZone: string;
|
|
@@ -229,6 +237,8 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
|
|
|
229
237
|
};
|
|
230
238
|
bikes: BikeProduct[];
|
|
231
239
|
accessories: AccessoryProduct[];
|
|
240
|
+
bookingBikes: BikeProduct[];
|
|
241
|
+
bookingAccessories: AccessoryProduct[];
|
|
232
242
|
language: StorefrontI18nLanguage;
|
|
233
243
|
}>;
|
|
234
244
|
export default function StorefrontProvider(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -296,8 +306,14 @@ export declare function useStorefrontConfig(): {
|
|
|
296
306
|
percentage: number;
|
|
297
307
|
optimizeDepositAmount: boolean;
|
|
298
308
|
};
|
|
309
|
+
cancellationPolicy: {
|
|
310
|
+
tiers: {
|
|
311
|
+
upToHours: number;
|
|
312
|
+
refundPercentage: number;
|
|
313
|
+
}[];
|
|
314
|
+
};
|
|
299
315
|
securityDeposit: {
|
|
300
|
-
mode: "optional" | "
|
|
316
|
+
mode: "optional" | "disabled" | "required";
|
|
301
317
|
};
|
|
302
318
|
shop: {
|
|
303
319
|
timeZone: string;
|
|
@@ -512,8 +528,14 @@ export declare function useStorefrontConfig(): {
|
|
|
512
528
|
percentage: number;
|
|
513
529
|
optimizeDepositAmount: boolean;
|
|
514
530
|
};
|
|
531
|
+
cancellationPolicy: {
|
|
532
|
+
tiers: {
|
|
533
|
+
upToHours: number;
|
|
534
|
+
refundPercentage: number;
|
|
535
|
+
}[];
|
|
536
|
+
};
|
|
515
537
|
securityDeposit: {
|
|
516
|
-
mode: "optional" | "
|
|
538
|
+
mode: "optional" | "disabled" | "required";
|
|
517
539
|
};
|
|
518
540
|
shop: {
|
|
519
541
|
timeZone: string;
|
|
@@ -673,5 +695,9 @@ export declare function useStorefrontProducts(): {
|
|
|
673
695
|
bikes: BikeProduct[];
|
|
674
696
|
accessories: AccessoryProduct[];
|
|
675
697
|
};
|
|
698
|
+
export declare function useStorefrontBookingProducts(): {
|
|
699
|
+
bikes: BikeProduct[];
|
|
700
|
+
accessories: AccessoryProduct[];
|
|
701
|
+
};
|
|
676
702
|
export {};
|
|
677
703
|
//# sourceMappingURL=StorefrontProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAiC,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,
|
|
1
|
+
{"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAiC,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAGvB,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,kBAAkB,EAAE,gBAAgB,EAAE,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,sBAAsB,CAAA;CACjC,CAAA;AAKD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEA,CAAA;AAGnB,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAkBzC;AAED,wBAAgB,aAAa,2BAQ5B;AAED,wBAAgB,qBAAqB,uCAEpC;AAED,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC;AAED,wBAAgB,8BAA8B,IAAI,sBAAsB,CAGvE;AAED,wBAAgB,qBAAqB;;;EAGpC;AAED,wBAAgB,4BAA4B;;;EAG3C"}
|
|
@@ -1,96 +1,105 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useLoaderData as
|
|
4
|
-
import { apiClient as
|
|
5
|
-
import { Layout as
|
|
6
|
-
import { I18nProvider as
|
|
7
|
-
import { storefrontConfigurationSchema as
|
|
8
|
-
import { ROUTE as
|
|
9
|
-
import { toStorefrontBikeProducts as
|
|
10
|
-
const
|
|
11
|
-
const t = typeof
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as b, useContext as v } from "react";
|
|
3
|
+
import { useLoaderData as L } from "@rpcbase/router";
|
|
4
|
+
import { apiClient as P } from "@rpcbase/client";
|
|
5
|
+
import { Layout as _ } from "./components/Layout/index.js";
|
|
6
|
+
import { I18nProvider as R, resolveStorefrontI18nRequestLanguage as B, detectStorefrontI18nLanguage as E } from "./i18n/I18nProvider.js";
|
|
7
|
+
import { storefrontConfigurationSchema as I } from "./storefrontSchemas.js";
|
|
8
|
+
import { ROUTE as O, responseSchema as y } from "./lib/storefrontProducts.js";
|
|
9
|
+
import { toStorefrontBikeProducts as T, toStorefrontAccessoryProducts as A, toStorefrontBookingProductsCollections as x } from "./lib/products.js";
|
|
10
|
+
const U = {}, d = b(void 0), W = (async ({ ctx: o, params: e }) => {
|
|
11
|
+
const t = typeof e.storeSlug == "string" ? e.storeSlug.trim().toLowerCase() : "";
|
|
12
12
|
if (!t) throw new Response("Store not found", { status: 404, statusText: "Store not found" });
|
|
13
13
|
try {
|
|
14
|
-
const n =
|
|
15
|
-
if (
|
|
14
|
+
const n = P.get(O, { storeSlug: t }, o).then((r) => ({ ok: !0, productsResponse: r })).catch((r) => ({ ok: !1, productsError: r })), c = await P.get("/api/public/storefront/config", { storeSlug: t }, o), l = typeof c == "object" && c !== null ? c : {};
|
|
15
|
+
if (l.success !== !0)
|
|
16
16
|
throw new Response("Store not found", { status: 404, statusText: "Store not found" });
|
|
17
|
-
const s =
|
|
17
|
+
const s = I.safeParse(l.storefrontConfiguration);
|
|
18
18
|
if (!s.success)
|
|
19
19
|
throw console.error("Invalid storefront config received", s.error.flatten()), new Response("Storefront config invalid", { status: 500 });
|
|
20
|
-
let
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
console.error("Error fetching storefront products:",
|
|
20
|
+
let i = [], u = [], p = [], k = [];
|
|
21
|
+
const f = await n;
|
|
22
|
+
if (!f.ok)
|
|
23
|
+
console.error("Error fetching storefront products:", f.productsError);
|
|
24
24
|
else {
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
console.error("Invalid storefront products received",
|
|
28
|
-
else if (!
|
|
29
|
-
console.error("Storefront products unavailable",
|
|
25
|
+
const r = y.safeParse(f.productsResponse);
|
|
26
|
+
if (!r.success)
|
|
27
|
+
console.error("Invalid storefront products received", r.error.flatten());
|
|
28
|
+
else if (!r.data.success)
|
|
29
|
+
console.error("Storefront products unavailable", r.data.message ?? "Unknown error");
|
|
30
30
|
else {
|
|
31
|
-
const w =
|
|
32
|
-
|
|
31
|
+
const w = r.data.products;
|
|
32
|
+
i = T(w?.bikes ?? []), u = A(w?.accessories ?? []);
|
|
33
|
+
const h = x({ bikes: i, accessories: u });
|
|
34
|
+
p = h.bikes, k = h.accessories;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
const
|
|
37
|
+
const m = s.data.workspace?.languages ?? null, S = s.data.workspace?.workspaceLanguage ?? null, C = o?.req ? B({
|
|
36
38
|
cookieHeader: o.req.headers?.cookie,
|
|
37
39
|
acceptLanguageHeader: o.req.headers?.["accept-language"],
|
|
38
|
-
configuredLanguages:
|
|
39
|
-
configuredFallbackLanguage:
|
|
40
|
-
}) :
|
|
40
|
+
configuredLanguages: m,
|
|
41
|
+
configuredFallbackLanguage: S
|
|
42
|
+
}) : E(m, S);
|
|
41
43
|
return {
|
|
42
44
|
storeSlug: t,
|
|
43
45
|
storefrontConfiguration: s.data,
|
|
44
|
-
bikes:
|
|
45
|
-
accessories:
|
|
46
|
-
|
|
46
|
+
bikes: i,
|
|
47
|
+
accessories: u,
|
|
48
|
+
bookingBikes: p,
|
|
49
|
+
bookingAccessories: k,
|
|
50
|
+
language: C
|
|
47
51
|
};
|
|
48
52
|
} catch (n) {
|
|
49
53
|
throw n instanceof Response ? n : (console.error("Error fetching storefront config:", n), new Response("Storefront config unavailable", { status: 500 }));
|
|
50
54
|
}
|
|
51
55
|
});
|
|
52
|
-
function
|
|
53
|
-
const o =
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
+
function z() {
|
|
57
|
+
const o = L(), e = U, t = typeof e?.RB_PUBLIC_MAPBOX_TOKEN == "string" && e.RB_PUBLIC_MAPBOX_TOKEN.trim().length > 0 ? e.RB_PUBLIC_MAPBOX_TOKEN : void 0;
|
|
58
|
+
return /* @__PURE__ */ g(d.Provider, { value: { ...o, mapboxToken: t }, children: /* @__PURE__ */ g(
|
|
59
|
+
R,
|
|
56
60
|
{
|
|
57
61
|
initialLanguage: o.language,
|
|
58
62
|
configuredLanguages: o.storefrontConfiguration.workspace?.languages,
|
|
59
63
|
configuredFallbackLanguage: o.storefrontConfiguration.workspace?.workspaceLanguage,
|
|
60
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ g(_, { storefrontConfiguration: o.storefrontConfiguration })
|
|
61
65
|
}
|
|
62
66
|
) });
|
|
63
67
|
}
|
|
64
|
-
function
|
|
65
|
-
const o =
|
|
68
|
+
function a() {
|
|
69
|
+
const o = v(d);
|
|
66
70
|
if (o === void 0)
|
|
67
71
|
throw new Error("must be used within the provider");
|
|
68
72
|
return o;
|
|
69
73
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
74
|
+
function G() {
|
|
75
|
+
return v(d);
|
|
72
76
|
}
|
|
73
|
-
function
|
|
74
|
-
const { storefrontConfiguration: o } =
|
|
77
|
+
function J() {
|
|
78
|
+
const { storefrontConfiguration: o } = a();
|
|
75
79
|
return {
|
|
76
80
|
config: o,
|
|
77
81
|
storefrontConfiguration: o
|
|
78
82
|
};
|
|
79
83
|
}
|
|
80
|
-
function
|
|
81
|
-
const { storefrontConfiguration: o } =
|
|
84
|
+
function Q() {
|
|
85
|
+
const { storefrontConfiguration: o } = a();
|
|
82
86
|
return o.workspace?.workspaceLanguage ?? "en";
|
|
83
87
|
}
|
|
84
|
-
function
|
|
85
|
-
const { bikes: o, accessories:
|
|
86
|
-
return { bikes: o, accessories:
|
|
88
|
+
function V() {
|
|
89
|
+
const { bikes: o, accessories: e } = a();
|
|
90
|
+
return { bikes: o, accessories: e };
|
|
91
|
+
}
|
|
92
|
+
function Y() {
|
|
93
|
+
const { bookingBikes: o, bookingAccessories: e } = a();
|
|
94
|
+
return { bikes: o, accessories: e };
|
|
87
95
|
}
|
|
88
96
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
z as default,
|
|
98
|
+
W as loader,
|
|
99
|
+
G as useOptionalStorefront,
|
|
100
|
+
a as useStorefront,
|
|
101
|
+
Y as useStorefrontBookingProducts,
|
|
102
|
+
J as useStorefrontConfig,
|
|
103
|
+
V as useStorefrontProducts,
|
|
104
|
+
Q as useStorefrontWorkspaceLanguage
|
|
96
105
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z as o } from "zod";
|
|
2
|
-
import { identifierSchema as
|
|
3
|
-
import { productKindSchema as
|
|
2
|
+
import { identifierSchema as n, isoDateTimeSchema as e, ulidStringSchema as p, objectIdStringSchema as m } from "../models/types-DLcvzW5b.js";
|
|
3
|
+
import { productKindSchema as c, productVariantCodeSchema as s } from "../models/Product.shared-BiDGmurZ.js";
|
|
4
4
|
import { moneyMinorSchema as r } from "./money-Dy4b9loa.js";
|
|
5
|
-
import { richTextSchema as
|
|
6
|
-
|
|
5
|
+
import { richTextSchema as d } from "./rich-text-CqXhNDN3.js";
|
|
6
|
+
import { cancellationPolicySchema as a } from "./booking-engine-configuration-DTJD2G9w.js";
|
|
7
|
+
const l = o.enum([
|
|
7
8
|
"pending_approval",
|
|
8
9
|
"pending_payment",
|
|
9
10
|
"confirmed",
|
|
@@ -11,17 +12,17 @@ const d = o.enum([
|
|
|
11
12
|
"completed",
|
|
12
13
|
"canceled",
|
|
13
14
|
"expired"
|
|
14
|
-
]),
|
|
15
|
-
_id:
|
|
16
|
-
productId:
|
|
17
|
-
kind:
|
|
15
|
+
]), u = o.object({
|
|
16
|
+
_id: n,
|
|
17
|
+
productId: n,
|
|
18
|
+
kind: c,
|
|
18
19
|
qty: o.number().int().positive(),
|
|
19
|
-
productVariantId:
|
|
20
|
+
productVariantId: n.optional(),
|
|
20
21
|
productShortCode: o.string().trim().min(1).max(3).optional(),
|
|
21
22
|
productName: o.string().trim().min(1).optional(),
|
|
22
23
|
productVariantName: o.string().trim().min(1).optional(),
|
|
23
24
|
productVariantCode: s.optional()
|
|
24
|
-
}),
|
|
25
|
+
}), g = o.object({
|
|
25
26
|
name: o.preprocess(
|
|
26
27
|
(t) => {
|
|
27
28
|
if (typeof t != "string") return;
|
|
@@ -46,30 +47,32 @@ const d = o.enum([
|
|
|
46
47
|
},
|
|
47
48
|
o.string().min(1).optional()
|
|
48
49
|
),
|
|
49
|
-
message:
|
|
50
|
-
}),
|
|
51
|
-
_id:
|
|
52
|
-
externalId:
|
|
53
|
-
state:
|
|
54
|
-
shopId:
|
|
55
|
-
customer:
|
|
50
|
+
message: d.optional()
|
|
51
|
+
}), A = o.object({
|
|
52
|
+
_id: m,
|
|
53
|
+
externalId: p,
|
|
54
|
+
state: l,
|
|
55
|
+
shopId: n,
|
|
56
|
+
customer: g,
|
|
56
57
|
deliveryOption: o.enum(["delivery", "pickup"]),
|
|
57
|
-
start:
|
|
58
|
-
end:
|
|
58
|
+
start: e,
|
|
59
|
+
end: e,
|
|
59
60
|
startAddress: o.string().optional(),
|
|
60
61
|
endAddress: o.string().optional(),
|
|
61
|
-
items: o.array(
|
|
62
|
+
items: o.array(u),
|
|
62
63
|
couponCode: o.string().min(1).optional(),
|
|
63
64
|
couponDiscountRate: o.number().min(0).max(1).optional(),
|
|
64
65
|
couponDiscountAmountUnits: r.optional(),
|
|
65
66
|
couponAutoApplied: o.boolean().optional(),
|
|
66
|
-
couponPriceRuleId:
|
|
67
|
+
couponPriceRuleId: n.optional(),
|
|
67
68
|
totalPriceUnits: r.optional(),
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
cancellationPolicySnapshot: a.optional(),
|
|
70
|
+
cancellationPolicyOverride: a.optional(),
|
|
71
|
+
createdAt: e,
|
|
72
|
+
updatedAt: e
|
|
70
73
|
});
|
|
71
74
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
u as baseBookingItemSchema,
|
|
76
|
+
A as baseBookingSchema,
|
|
77
|
+
l as baseBookingStateSchema
|
|
75
78
|
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { localizedStringSchema as m } from "../models/LocalizedString--6q77SPQ.js";
|
|
3
|
+
import { priceUnitSchema as n } from "../models/Price-BlFRDHXV.js";
|
|
4
|
+
import { currencyCodeSchema as l } from "./money-Dy4b9loa.js";
|
|
5
|
+
import { shopConfigurationSchema as c } from "./shop-opening-hours-DqNWstqT.js";
|
|
6
|
+
import { isoDateSchema as x, shopExtraTimeSlotRuleSchema as z, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as Y, shopOpeningHoursPeriodSchema as $, shopOpeningSlotSchema as Z, timeOfDaySchema as B } from "./shop-opening-hours-DqNWstqT.js";
|
|
7
|
+
const u = [
|
|
8
|
+
"soldOutOnly",
|
|
9
|
+
"soldOutAndFewRemaining",
|
|
10
|
+
"fewRemaining",
|
|
11
|
+
"fewRemainingCounts",
|
|
12
|
+
"remainingCounts"
|
|
13
|
+
], p = e.enum(u, {
|
|
14
|
+
message: "Availability display mode must be one of 'soldOutOnly', 'soldOutAndFewRemaining', 'fewRemaining', 'fewRemainingCounts', or 'remainingCounts'"
|
|
15
|
+
}), d = /* @__PURE__ */ new Set([
|
|
16
|
+
"soldOutAndFewRemaining",
|
|
17
|
+
"fewRemaining",
|
|
18
|
+
"fewRemainingCounts"
|
|
19
|
+
]), h = (a) => d.has(a), g = {
|
|
20
|
+
message: "A defaultFewRemainingThreshold is required for display modes that highlight 'few remaining' states"
|
|
21
|
+
}, b = e.object({
|
|
22
|
+
defaultMode: p,
|
|
23
|
+
defaultFewRemainingThreshold: e.number().int().min(1).optional()
|
|
24
|
+
}).refine(
|
|
25
|
+
(a) => !h(a.defaultMode) || a.defaultFewRemainingThreshold !== void 0,
|
|
26
|
+
g
|
|
27
|
+
), f = e.object({
|
|
28
|
+
enabled: e.boolean(),
|
|
29
|
+
defaultTtlMinutes: e.number().int().min(1)
|
|
30
|
+
}), y = e.object({
|
|
31
|
+
unit: n,
|
|
32
|
+
label: m.optional(),
|
|
33
|
+
durationHours: e.number().positive()
|
|
34
|
+
}), S = e.object({
|
|
35
|
+
enabled: e.boolean(),
|
|
36
|
+
boundaryHour: e.number().int().min(0).max(23)
|
|
37
|
+
}), D = e.object({
|
|
38
|
+
baseUnit: n,
|
|
39
|
+
rentalUnits: e.array(y).min(1),
|
|
40
|
+
halfDay: S.optional()
|
|
41
|
+
}).refine(
|
|
42
|
+
(a) => a.rentalUnits.some((o) => o.unit === a.baseUnit),
|
|
43
|
+
{ message: "Rental units must include the configured base unit" }
|
|
44
|
+
), t = e.number().min(0, { message: "Percentage must be greater than or equal to 0" }).max(1, { message: "Percentage must be less than or equal to 1" }), s = e.object({
|
|
45
|
+
enabled: e.boolean(),
|
|
46
|
+
percentage: t,
|
|
47
|
+
optimizeDepositAmount: e.boolean().default(!1)
|
|
48
|
+
}), C = e.object({
|
|
49
|
+
upToHours: e.number().int().positive(),
|
|
50
|
+
refundPercentage: t
|
|
51
|
+
}), O = e.object({
|
|
52
|
+
tiers: e.array(C).default([])
|
|
53
|
+
}).superRefine((a, o) => {
|
|
54
|
+
for (let i = 1; i < a.tiers.length; i += 1)
|
|
55
|
+
a.tiers[i].upToHours <= a.tiers[i - 1].upToHours && o.addIssue({
|
|
56
|
+
code: e.ZodIssueCode.custom,
|
|
57
|
+
message: "Cancellation policy tiers must be ordered by increasing duration",
|
|
58
|
+
path: ["tiers", i, "upToHours"]
|
|
59
|
+
});
|
|
60
|
+
}), w = {
|
|
61
|
+
tiers: []
|
|
62
|
+
}, R = ["disabled", "optional", "required"], r = e.object({
|
|
63
|
+
mode: e.enum(R, {
|
|
64
|
+
message: "Security deposit mode must be one of 'disabled', 'optional', or 'required'"
|
|
65
|
+
})
|
|
66
|
+
}), E = e.object({
|
|
67
|
+
bookingDeposit: s,
|
|
68
|
+
securityDeposit: r
|
|
69
|
+
}), q = {
|
|
70
|
+
bookingDeposit: {
|
|
71
|
+
enabled: !1,
|
|
72
|
+
percentage: 0.3,
|
|
73
|
+
optimizeDepositAmount: !1
|
|
74
|
+
},
|
|
75
|
+
securityDeposit: {
|
|
76
|
+
mode: "optional"
|
|
77
|
+
}
|
|
78
|
+
}, T = ["auto_approve_when_possible", "manual_approval_required"], _ = e.enum(T, {
|
|
79
|
+
message: "Checkout mode must be one of 'auto_approve_when_possible' or 'manual_approval_required'"
|
|
80
|
+
}), j = e.object({
|
|
81
|
+
strategy: e.string().optional()
|
|
82
|
+
}).catchall(e.unknown()), P = e.object({
|
|
83
|
+
mode: _,
|
|
84
|
+
dynamicOptions: j.optional()
|
|
85
|
+
}), k = l, I = e.object({
|
|
86
|
+
availabilityDisplay: b,
|
|
87
|
+
holdSettings: f,
|
|
88
|
+
pricing: D,
|
|
89
|
+
bookingDeposit: s,
|
|
90
|
+
cancellationPolicy: O.default(w),
|
|
91
|
+
securityDeposit: r,
|
|
92
|
+
checkout: P,
|
|
93
|
+
shop: c,
|
|
94
|
+
currency: k
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
w as DEFAULT_CANCELLATION_POLICY,
|
|
98
|
+
q as DEFAULT_PAYMENT_POLICIES,
|
|
99
|
+
b as availabilityDisplayConfigurationSchema,
|
|
100
|
+
p as availabilityDisplayModeSchema,
|
|
101
|
+
s as bookingDepositPolicySchema,
|
|
102
|
+
I as bookingEngineConfigurationSchema,
|
|
103
|
+
O as cancellationPolicySchema,
|
|
104
|
+
C as cancellationPolicyTierSchema,
|
|
105
|
+
P as checkoutConfigurationSchema,
|
|
106
|
+
j as checkoutDynamicOptionsSchema,
|
|
107
|
+
_ as checkoutModeSchema,
|
|
108
|
+
k as currencySchema,
|
|
109
|
+
f as holdSettingsSchema,
|
|
110
|
+
x as isoDateSchema,
|
|
111
|
+
E as paymentPoliciesSchema,
|
|
112
|
+
D as pricingConfigurationSchema,
|
|
113
|
+
S as pricingHalfDaySchema,
|
|
114
|
+
y as pricingUnitOptionSchema,
|
|
115
|
+
r as securityDepositPolicySchema,
|
|
116
|
+
c as shopConfigurationSchema,
|
|
117
|
+
z as shopExtraTimeSlotRuleSchema,
|
|
118
|
+
N as shopOpeningDaySchema,
|
|
119
|
+
Y as shopOpeningHoursOverrideSchema,
|
|
120
|
+
$ as shopOpeningHoursPeriodSchema,
|
|
121
|
+
Z as shopOpeningSlotSchema,
|
|
122
|
+
B as timeOfDaySchema
|
|
123
|
+
};
|
package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
2
|
import { identifierSchema as i } from "../models/types-DLcvzW5b.js";
|
|
3
3
|
import { moneyMinorSchema as a } from "./money-Dy4b9loa.js";
|
|
4
|
-
import { fulfillmentModeSchema as s } from "./public-booking-engine-configuration-
|
|
4
|
+
import { fulfillmentModeSchema as s } from "./public-booking-engine-configuration-CrwffLO4.js";
|
|
5
5
|
import { richTextSchema as m } from "./rich-text-CqXhNDN3.js";
|
|
6
6
|
import { timeOfDaySchema as r, isoDateSchema as n } from "./shop-opening-hours-DqNWstqT.js";
|
|
7
7
|
const p = e.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as o } from "zod";
|
|
2
|
-
import { checkoutConfigurationSchema as i, bookingEngineConfigurationSchema as a } from "./booking-engine-configuration-
|
|
2
|
+
import { checkoutConfigurationSchema as i, bookingEngineConfigurationSchema as a } from "./booking-engine-configuration-DTJD2G9w.js";
|
|
3
3
|
import { timeOfDaySchema as e } from "./shop-opening-hours-DqNWstqT.js";
|
|
4
4
|
const n = o.enum(["pickup", "delivery"]), t = o.object({
|
|
5
5
|
fulfillmentModes: o.array(n).min(1).optional(),
|
package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js}
RENAMED
|
@@ -7,7 +7,6 @@ import "./node_modules/@base-ui/react/esm/scroll-area/viewport/ScrollAreaViewpor
|
|
|
7
7
|
import "./node_modules/@base-ui/react/esm/scroll-area/corner/ScrollAreaCorner-z0cNScNF.js";
|
|
8
8
|
import "./node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbar-DGyLPhKe.js";
|
|
9
9
|
import "./node_modules/@base-ui/react/esm/scroll-area/thumb/ScrollAreaThumb-08Mmzry4.js";
|
|
10
|
-
import "./node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion-Cc0tLlFf.js";
|
|
11
10
|
import "./node_modules/motion-dom/dist/es/value/types/color/rgba-BIy7YqPw.js";
|
|
12
11
|
import "./node_modules/motion-dom/dist/es/value/types/numbers/index-CWjqASeJ.js";
|
|
13
12
|
import "./node_modules/motion-dom/dist/es/value/types/numbers/units-DNXf-Ngr.js";
|
|
@@ -15,13 +14,14 @@ import "./node_modules/motion-dom/dist/es/value/types/complex/filter-AXB6Rjjs.js
|
|
|
15
14
|
import "./node_modules/motion-dom/dist/es/value/types/complex/mask-AXB6Rjjs.js";
|
|
16
15
|
import "./node_modules/motion-dom/dist/es/value/types/int-CwcJvGhp.js";
|
|
17
16
|
import "./node_modules/motion-utils/dist/es/errors-CBdvTtJZ.js";
|
|
17
|
+
import "./node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion-Cc0tLlFf.js";
|
|
18
18
|
import "./node_modules/framer-motion/dist/es/context/LayoutGroupContext-BWutRI4l.js";
|
|
19
19
|
import "./node_modules/framer-motion/dist/es/context/LazyContext-yIDUGdfR.js";
|
|
20
20
|
import "./node_modules/framer-motion/dist/es/context/MotionConfigContext-C3EPauom.js";
|
|
21
21
|
import "./node_modules/framer-motion/dist/es/render/dom/utils/filter-props-DZcjZ2yt.js";
|
|
22
|
-
import "./node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js";
|
|
23
22
|
import "./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext-BWutRI4l.js";
|
|
24
|
-
import "./node_modules/
|
|
23
|
+
import "./node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js";
|
|
24
|
+
import "./node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js";
|
|
25
25
|
import "./node_modules/lucide-react/dist/esm/icons/arrow-left-asE1l_Qw.js";
|
|
26
26
|
import "./node_modules/lucide-react/dist/esm/icons/x-Cdi8GS7U.js";
|
|
27
27
|
const t = o(null), k = () => r(t);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { noop as r } from "../../../../../motion-utils/dist/es/noop-BGdtcOlD.js";
|
|
2
|
+
import "../../value/types/color/rgba-BIy7YqPw.js";
|
|
3
|
+
import "../../value/types/numbers/index-CWjqASeJ.js";
|
|
4
|
+
import "../../value/types/numbers/units-DNXf-Ngr.js";
|
|
5
|
+
import "../../../../../motion-utils/dist/es/errors-CBdvTtJZ.js";
|
|
6
|
+
import "../../animation/keyframes/utils/unit-conversion-Cc0tLlFf.js";
|
|
7
|
+
import "../../animation/optimized-appear/data-id-CNQuVmXa.js";
|
|
8
|
+
const o = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t);
|
|
9
|
+
o("applewebkit/") && !o("chrome/") || r;
|
|
@@ -42,7 +42,7 @@ function P({ preset: c }) {
|
|
|
42
42
|
return m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m);
|
|
43
43
|
}, [s]), /* @__PURE__ */ e("section", { id: "about", className: "border-t border-slate-200 bg-white scroll-mt-16 sm:scroll-mt-20", children: /* @__PURE__ */ n("div", { className: "lg:grid lg:grid-cols-2 lg:items-stretch", children: [
|
|
44
44
|
/* @__PURE__ */ e("div", { className: "px-4 py-10 sm:px-6 lg:px-0 lg:py-14", children: /* @__PURE__ */ n("div", { className: "mx-auto max-w-7xl lg:mx-0 lg:ml-auto lg:max-w-[40rem] lg:pl-6 lg:pr-8 xl:pr-12", children: [
|
|
45
|
-
/* @__PURE__ */ e("p", { className: "text-
|
|
45
|
+
/* @__PURE__ */ e("p", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: /* @__PURE__ */ e("span", { children: o("about_section_title") }) }),
|
|
46
46
|
/* @__PURE__ */ e("h2", { className: "mt-2 text-2xl font-semibold tracking-tight text-slate-950 sm:text-3xl", children: /* @__PURE__ */ e("span", { children: o("about_section_heading") }) }),
|
|
47
47
|
s ? /* @__PURE__ */ n(C, { children: [
|
|
48
48
|
/* @__PURE__ */ n("div", { className: "relative mt-4", children: [
|
|
@@ -10,8 +10,9 @@ type BikeProductCardProps = {
|
|
|
10
10
|
actionDisabled?: boolean;
|
|
11
11
|
availabilityLabel?: string;
|
|
12
12
|
fallbackLanguage?: string;
|
|
13
|
+
variant?: "default" | "booking";
|
|
13
14
|
testId?: string;
|
|
14
15
|
};
|
|
15
|
-
export declare function BikeProductCard({ bike, detailsPath, productDetailsLinkState, actionLabelKey, onAction, actionDisabled, availabilityLabel, fallbackLanguage, testId, }: BikeProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function BikeProductCard({ bike, detailsPath, productDetailsLinkState, actionLabelKey, onAction, actionDisabled, availabilityLabel, fallbackLanguage, variant, testId, }: BikeProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,GACP,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,OAAmB,EACnB,MAAM,GACP,EAAE,oBAAoB,2CA2FtB"}
|