@loczer/storefront-sdk 0.162.0 → 0.163.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/index.d.ts +33 -2
- package/dist/index.js +308 -303
- package/dist/lib/products.d.ts +23 -2
- package/dist/lib/products.d.ts.map +1 -1
- package/dist/lib/products.js +69 -36
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -823,11 +823,28 @@ export declare const cartItemInputSchema: z.ZodObject<{
|
|
|
823
823
|
qty: z.ZodNumber;
|
|
824
824
|
}, z.core.$strip>;
|
|
825
825
|
|
|
826
|
+
export declare const CATALOG_PRODUCT_BASE_RATE_UNSET = -1;
|
|
827
|
+
|
|
828
|
+
export declare type CatalogProductPaginationSort = Array<{
|
|
829
|
+
field: CatalogProductSortField;
|
|
830
|
+
order: "asc" | "desc";
|
|
831
|
+
}>;
|
|
832
|
+
|
|
833
|
+
export declare type CatalogProductSortField = "kind" | "assetRelScore" | "baseHourlyRateMinor" | "baseHalfDayRateMinor" | "baseDailyRateMinor" | "baseWeeklyRateMinor" | "baseMonthlyRateMinor" | "externalId";
|
|
834
|
+
|
|
835
|
+
export declare type CatalogProductSortOptions = {
|
|
836
|
+
priceUnit?: CatalogProductSortPriceUnit;
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
export declare type CatalogProductSortPriceUnit = StorefrontPublicProductPrice["unit"];
|
|
840
|
+
|
|
826
841
|
export { cn }
|
|
827
842
|
|
|
828
|
-
export declare function
|
|
843
|
+
export declare function compareCatalogProducts<T extends SortableCatalogProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
|
|
844
|
+
|
|
845
|
+
export declare function compareStorefrontAccessoryProducts<T extends SortableStorefrontProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
|
|
829
846
|
|
|
830
|
-
export declare function compareStorefrontBikeProducts<T extends SortableStorefrontBikeProduct>(left: T, right: T): number;
|
|
847
|
+
export declare function compareStorefrontBikeProducts<T extends SortableStorefrontBikeProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
|
|
831
848
|
|
|
832
849
|
export declare function ContactSection({ preset, storeSlug }: {
|
|
833
850
|
preset: StorefrontPreset;
|
|
@@ -1535,6 +1552,12 @@ export declare const getBookingParamsFromSearch: (searchParams: URLSearchParams,
|
|
|
1535
1552
|
|
|
1536
1553
|
export declare const getBookingSessionStorageKey: (storeSlug?: string) => string;
|
|
1537
1554
|
|
|
1555
|
+
export declare function getCatalogProductBaseRateMinor(prices: StorefrontPublicProductPrice[] | undefined, priceUnit?: CatalogProductSortPriceUnit): number;
|
|
1556
|
+
|
|
1557
|
+
export declare function getCatalogProductPaginationSort(priceUnit: CatalogProductSortPriceUnit): CatalogProductPaginationSort;
|
|
1558
|
+
|
|
1559
|
+
export declare function getCatalogProductSortFieldForPriceUnit(unit: CatalogProductSortPriceUnit): CatalogProductSortField;
|
|
1560
|
+
|
|
1538
1561
|
export declare type GetContractSaleDocumentRequest = z.infer<typeof getContractSaleDocumentRequestSchema>;
|
|
1539
1562
|
|
|
1540
1563
|
export declare const getContractSaleDocumentRequestSchema: z.ZodObject<{
|
|
@@ -2684,6 +2707,14 @@ declare const Slot: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTM
|
|
|
2684
2707
|
children?: React_2.ReactNode;
|
|
2685
2708
|
} & React_2.RefAttributes<HTMLElement>>;
|
|
2686
2709
|
|
|
2710
|
+
declare type SortableCatalogProduct = {
|
|
2711
|
+
id?: string;
|
|
2712
|
+
externalId?: string;
|
|
2713
|
+
kind?: string;
|
|
2714
|
+
prices?: StorefrontPublicProductPrice[];
|
|
2715
|
+
assetRelScore?: number;
|
|
2716
|
+
};
|
|
2717
|
+
|
|
2687
2718
|
declare type SortableStorefrontBikeProduct = SortableStorefrontProduct & {
|
|
2688
2719
|
kind?: StorefrontPublicBikeProduct["kind"];
|
|
2689
2720
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,346 +1,351 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { storefrontCheckoutModeSchema as p, storefrontConfigurationSchema as h, storefrontContentSchema as d, storefrontFaqItemSchema as g, storefrontFaqSchema as T, storefrontFulfillmentModeSchema as
|
|
3
|
-
import { DEFAULT_STOREFRONT_PRESET as
|
|
4
|
-
import { BOOKING_SEARCH_KEYS as M, TIME_OPTIONS as
|
|
2
|
+
import { storefrontCheckoutModeSchema as p, storefrontConfigurationSchema as h, storefrontContentSchema as d, storefrontFaqItemSchema as g, storefrontFaqSchema as T, storefrontFulfillmentModeSchema as P, storefrontLocalizedRichTextSchema as x, storefrontModalMessageSchema as R, storefrontModulesSchema as C, storefrontReviewsModuleSchema as D, storefrontRichTextSchema as A, storefrontSettingsSchema as O, storefrontShopSchema as b, storefrontStatusSchema as E, storefrontWorkspaceSchema as B } from "./storefrontSchemas.js";
|
|
3
|
+
import { DEFAULT_STOREFRONT_PRESET as y, STOREFRONT_PRESETS as I, getStorefrontPreset as F } from "./data/config.js";
|
|
4
|
+
import { BOOKING_SEARCH_KEYS as M, TIME_OPTIONS as U, applyBookingParamsToSearch as v, createBookingPeriodConfigFromBookingEngineConfiguration as L, createBookingPeriodConfigFromStorefrontConfiguration as N, getBookingDurationLabel as q, getBookingDurationMinutes as V, getBookingParamsFromSearch as w, getBookingSessionStorageKey as z, getDefaultBookingParams as H, getDefaultBookingParamsForStorefrontConfiguration as K, pickBookingSearchParams as W, readBookingSearchParamsFromSessionStorage as G, readBookingSearchParamsFromStorage as J, resolveBookingSearchParams as Y, resolveBookingSearchParamsFromSessionStorage as j, writeBookingSearchParamsToSessionStorage as Q, writeBookingSearchParamsToStorage as X } from "./lib/booking.js";
|
|
5
5
|
import { StorefrontCartProvider as $, useStorefrontCart as ee } from "./lib/cart.js";
|
|
6
6
|
import { buildStorefrontCartSummary as te } from "./lib/cartSummary.js";
|
|
7
|
-
import {
|
|
8
|
-
import { buildDailyPriceRows as
|
|
9
|
-
import { formatPriceMinor as
|
|
10
|
-
import { ROUTE as
|
|
11
|
-
import { buildWhatsAppHref as
|
|
12
|
-
import { ROUTE as
|
|
13
|
-
import { ROUTE as
|
|
14
|
-
import { ROUTE as
|
|
15
|
-
import { ROUTE as
|
|
16
|
-
import { ROUTE as
|
|
17
|
-
import { Layout as
|
|
18
|
-
import { Footer as
|
|
19
|
-
import { Header as
|
|
20
|
-
import { DelayedPlaceholder as
|
|
21
|
-
import { PlatformFooter as
|
|
22
|
-
import { PoweredByLoczerBadge as
|
|
23
|
-
import { BookingPeriodSelector as
|
|
24
|
-
import { BookingFlowSteps as
|
|
25
|
-
import { DeliveryAddressSelector as
|
|
26
|
-
import { ContactSection as
|
|
27
|
-
import { TestimonialsSection as
|
|
28
|
-
import { AboutSection as
|
|
29
|
-
import { WhatsAppFloatingButton as
|
|
30
|
-
import { useWhatsAppFloatingButton as
|
|
31
|
-
import { StepSectionTitle as
|
|
32
|
-
import { StorefrontCartPanel as
|
|
33
|
-
import { ProductPriceBadge as
|
|
34
|
-
import { ProductWarningNotice as
|
|
35
|
-
import { ContractSaleDocument as
|
|
7
|
+
import { CATALOG_PRODUCT_BASE_RATE_UNSET as ae, buildStorefrontProductSlug as ce, compareCatalogProducts as ne, compareStorefrontAccessoryProducts as ie, compareStorefrontBikeProducts as me, findStorefrontProduct as Se, findStorefrontProductBySlug as se, getCatalogProductBaseRateMinor as ue, getCatalogProductPaginationSort as le, getCatalogProductSortFieldForPriceUnit as fe, getStorefrontBaseDailyRateMinor as pe, getStorefrontCheckoutProductId as he, getStorefrontRepresentedVariantId as de, toStorefrontAccessoryProducts as ge, toStorefrontBikeProducts as Te } from "./lib/products.js";
|
|
8
|
+
import { buildDailyPriceRows as xe, buildPriceTierLabels as Re, calculateDailyPriceForQuantity as Ce, formatStorefrontPriceMinor as De } from "./lib/pricing.js";
|
|
9
|
+
import { formatPriceMinor as Oe, getAvailabilityVariant as be, getMinDayPriceMinor as Ee } from "./lib/utils.js";
|
|
10
|
+
import { ROUTE as ke, requestSchema as ye, responseSchema as Ie } from "./lib/contactForm.js";
|
|
11
|
+
import { buildWhatsAppHref as _e, resolveStorefrontWhatsAppContact as Me, resolveStorefrontWhatsAppHref as Ue } from "./lib/whatsapp.js";
|
|
12
|
+
import { ROUTE as Le, requestDeliveryRefinement as Ne, requestCheckoutItemSchema as qe, requestBaseSchema as Ve, requestSchema as we, responseSchema as ze } from "./lib/checkoutSubmit.js";
|
|
13
|
+
import { ROUTE as Ke, requestSchema as We, responseSchema as Ge, storefrontPublicAccessoryProductSchema as Je, storefrontPublicBikeAvailabilityStatusSchema as Ye, storefrontPublicBikeProductSchema as je, storefrontPublicProductDisplayModeSchema as Qe, storefrontPublicProductPriceSchema as Xe, storefrontPublicProductVariantAttributeSchema as Ze, storefrontPublicProductVariantIdentifierSchema as $e, storefrontPublicProductVariantSchema as eo } from "./lib/storefrontProducts.js";
|
|
14
|
+
import { ROUTE as to, buildStorefrontAvailabilityKey as ro, doesStorefrontAvailabilityDisplaySoldOut as ao, getStorefrontAvailabilityIssue as co, getStorefrontAvailabilityStatus as no, isStorefrontAvailabilityInsufficient as io, publicAvailabilityDisplayModeSchema as mo, shouldBlockStorefrontUnavailableItem as So, storefrontAvailabilityProductSchema as so, requestSchema as uo, responseSchema as lo, storefrontAvailabilityScheduleSchema as fo, storefrontPublicAvailabilityRecordSchema as po } from "./lib/storefrontAvailability.js";
|
|
15
|
+
import { ROUTE as go, buildStorefrontImageUrl as To, requestSchema as Po } from "./lib/storefrontImage.js";
|
|
16
|
+
import { ROUTE as Ro, timeSlotJourneySchema as Co, storefrontTimeSlotSchema as Do, requestSchema as Ao, responseSchema as Oo } from "./lib/storefrontTimeSlots.js";
|
|
17
|
+
import { Layout as Eo } from "./components/Layout/index.js";
|
|
18
|
+
import { Footer as ko } from "./components/Footer/index.js";
|
|
19
|
+
import { Header as Io } from "./components/Header/index.js";
|
|
20
|
+
import { DelayedPlaceholder as _o, DelayedReveal as Mo } from "./components/DelayedReveal/index.js";
|
|
21
|
+
import { PlatformFooter as vo } from "./components/PlatformFooter/index.js";
|
|
22
|
+
import { PoweredByLoczerBadge as No } from "./components/PoweredByLoczerBadge/index.js";
|
|
23
|
+
import { BookingPeriodSelector as Vo } from "./components/BookingPeriodSelector/index.js";
|
|
24
|
+
import { BookingFlowSteps as zo } from "./components/BookingFlowSteps/index.js";
|
|
25
|
+
import { DeliveryAddressSelector as Ko } from "./components/DeliveryAddressSelector/index.js";
|
|
26
|
+
import { ContactSection as Go } from "./components/ContactSection/index.js";
|
|
27
|
+
import { TestimonialsSection as Yo } from "./components/TestimonialsSection/index.js";
|
|
28
|
+
import { AboutSection as Qo } from "./components/AboutSection/index.js";
|
|
29
|
+
import { WhatsAppFloatingButton as Zo } from "./components/WhatsAppFloatingButton/WhatsAppFloatingButton.js";
|
|
30
|
+
import { useWhatsAppFloatingButton as et } from "./components/WhatsAppFloatingButton/useWhatsAppFloatingButton.js";
|
|
31
|
+
import { StepSectionTitle as tt } from "./components/StepSectionTitle/index.js";
|
|
32
|
+
import { StorefrontCartPanel as at } from "./components/StorefrontCartPanel/index.js";
|
|
33
|
+
import { ProductPriceBadge as nt } from "./components/ProductPriceBadge/index.js";
|
|
34
|
+
import { ProductWarningNotice as mt } from "./components/ProductWarningNotice/index.js";
|
|
35
|
+
import { ContractSaleDocument as st } from "./components/ContractSaleDocument/Invoice.js";
|
|
36
36
|
import "react/jsx-runtime";
|
|
37
37
|
import "react";
|
|
38
38
|
import "@rpcbase/client";
|
|
39
39
|
import "@rpcbase/router";
|
|
40
|
-
import { cn as
|
|
40
|
+
import { cn as lt } from "@rpcbase/ui";
|
|
41
41
|
import "lucide-react";
|
|
42
42
|
import "react-i18next";
|
|
43
|
-
import { getLocalizedEntry as
|
|
44
|
-
import { Badge as
|
|
45
|
-
import { Button as
|
|
46
|
-
import { Card as
|
|
47
|
-
import { loader as
|
|
48
|
-
import { RadioGroup as
|
|
43
|
+
import { getLocalizedEntry as pt, getLocalizedValue as ht } from "./localization.js";
|
|
44
|
+
import { Badge as gt, badgeVariants as Tt } from "./ui/badge.js";
|
|
45
|
+
import { Button as xt, buttonVariants as Rt } from "./ui/button.js";
|
|
46
|
+
import { Card as Dt, CardAction as At, CardContent as Ot, CardDescription as bt, CardFooter as Et, CardHeader as Bt, CardTitle as kt } from "./ui/card.js";
|
|
47
|
+
import { loader as It, useOptionalStorefront as Ft, useStorefront as _t, useStorefrontConfig as Mt, useStorefrontProducts as Ut, useStorefrontWorkspaceLanguage as vt } from "./StorefrontProvider.js";
|
|
48
|
+
import { RadioGroup as Nt, RadioGroupItem as qt } from "./ui/radio-group.js";
|
|
49
49
|
import "./chunks/ui/dist/ResponsiveDialog-D8YzB_3J.js";
|
|
50
|
-
import { Input as
|
|
50
|
+
import { Input as wt } from "./ui/input.js";
|
|
51
51
|
import "@rpcbase/form";
|
|
52
52
|
import "./lib/checkoutPaymentDecision.js";
|
|
53
53
|
import "./lib/checkoutVerifyCoupon.js";
|
|
54
|
-
import { Form as
|
|
55
|
-
import { Textarea as
|
|
54
|
+
import { Form as Ht, FormControl as Kt, FormDescription as Wt, FormField as Gt, FormItem as Jt, FormLabel as Yt, FormMessage as jt, useFormField as Qt } from "./ui/form.js";
|
|
55
|
+
import { Textarea as Zt } from "./ui/textarea.js";
|
|
56
56
|
import "./pages/checkout/types.js";
|
|
57
|
-
import { accessories as
|
|
58
|
-
import { default as
|
|
59
|
-
import { contractSaleDocumentAcceptanceLevelSchema as
|
|
60
|
-
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as
|
|
61
|
-
import { storefront as
|
|
62
|
-
import { storefront as
|
|
63
|
-
import { default as
|
|
64
|
-
import { Label as
|
|
65
|
-
import { Select as
|
|
66
|
-
import { bookingCustomerInputSchema as
|
|
67
|
-
import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as
|
|
68
|
-
import { createLocalizedStringEntry as
|
|
69
|
-
import { priceSchema as
|
|
70
|
-
import { baseAssetSchema as
|
|
71
|
-
import { baseBookingItemSchema as
|
|
72
|
-
import { richTextJsonDocSchema as
|
|
73
|
-
import { currencyCodeSchema as
|
|
74
|
-
import { isoDateSchema as
|
|
75
|
-
import { fulfillmentModeSchema as
|
|
76
|
-
import { DEFAULT_PAYMENT_POLICIES as
|
|
77
|
-
import { BookingEndDateField as
|
|
78
|
-
import { BookingEndTimeField as
|
|
79
|
-
import { BookingMobileDateDrawer as
|
|
80
|
-
import { BookingPeriodProvider as
|
|
81
|
-
import { BookingStartDateField as
|
|
82
|
-
import { BookingStartTimeField as
|
|
57
|
+
import { accessories as er } from "./data/accessories.js";
|
|
58
|
+
import { default as tr } from "./data/bikes.js";
|
|
59
|
+
import { contractSaleDocumentAcceptanceLevelSchema as ar, contractSaleDocumentAcceptanceRecordSchema as cr, contractSaleDocumentAcceptanceSchema as nr, contractSaleDocumentAddressSchema as ir, contractSaleDocumentContactSchema as mr, contractSaleDocumentKindSchema as Sr, contractSaleDocumentLanguageCodeSchema as sr, contractSaleDocumentLanguageSchema as ur, contractSaleDocumentLineItemSchema as lr, contractSaleDocumentSchema as fr, contractSaleDocumentSignatureSchema as pr } from "./lib/contractSaleDocument.js";
|
|
60
|
+
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as dr, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as gr, GET_CONTRACT_SALE_DOCUMENT_ROUTE as Tr, acceptContractSaleDocumentRequestSchema as Pr, acceptContractSaleDocumentResponseSchema as xr, contractSaleDocumentAcceptanceInputSchema as Rr, contractSaleDocumentAcceptanceRecordInputSchema as Cr, contractSaleDocumentApiAcceptanceRecordSchema as Dr, contractSaleDocumentApiAcceptanceSchema as Ar, contractSaleDocumentApiSchema as Or, contractSaleDocumentApiSignatureSchema as br, contractSaleDocumentReferenceSchema as Er, contractSaleDocumentReferenceTypeSchema as Br, contractSaleDocumentSignatureInputSchema as kr, downloadContractSaleDocumentPdfRequestSchema as yr, getContractSaleDocumentRequestSchema as Ir, getContractSaleDocumentResponseSchema as Fr } from "./lib/contractSaleDocumentApi.js";
|
|
61
|
+
import { storefront as Mr } from "./i18n/en.js";
|
|
62
|
+
import { storefront as vr } from "./i18n/fr.js";
|
|
63
|
+
import { default as Nr } from "./routes.js";
|
|
64
|
+
import { Label as Vr } from "./ui/label.js";
|
|
65
|
+
import { Select as zr, SelectContent as Hr, SelectGroup as Kr, SelectIcon as Wr, SelectItem as Gr, SelectItemIndicator as Jr, SelectItemText as Yr, SelectLabel as jr, SelectScrollDownButton as Qr, SelectScrollUpButton as Xr, SelectSeparator as Zr, SelectTrigger as $r, SelectValue as ea } from "./ui/select.js";
|
|
66
|
+
import { bookingCustomerInputSchema as ta, bookingDeliveryOptionSchema as ra, bookingScheduleInputSchema as aa, cartItemInputSchema as ca, createBookingInputBaseSchema as na, createBookingInputSchema as ia, validateBookingDeliveryAddress as ma } from "./chunks/booking-engine/dist/schemas/cart-inputs-ByBK0IVJ.js";
|
|
67
|
+
import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as sa, PRODUCT_VARIANT_CODE_MAX_LENGTH as ua, accessoryProductSchema as la, bikeProductSchema as fa, eBikeProductSchema as pa, isProductVariantCodeIdentifierKind as ha, productKindSchema as da, productSchema as ga, productStorefrontDisplayModeSchema as Ta, productVariantAttributeSchema as Pa, productVariantCodeSchema as xa, productVariantIdentifierSchema as Ra, productVariantSchema as Ca } from "./chunks/booking-engine/dist/models/Product.shared-BiDGmurZ.js";
|
|
68
|
+
import { createLocalizedStringEntry as Aa, getLocalizedStringValue as Oa, localizedStringArraySchema as ba, localizedStringEntrySchema as Ea, localizedStringSchema as Ba } from "./chunks/booking-engine/dist/models/LocalizedString--6q77SPQ.js";
|
|
69
|
+
import { priceSchema as ya, priceUnitSchema as Ia } from "./chunks/booking-engine/dist/models/Price-BlFRDHXV.js";
|
|
70
|
+
import { baseAssetSchema as _a, baseAssetStatusSchema as Ma } from "./chunks/booking-engine/dist/schemas/base-asset-GJ9eIvIL.js";
|
|
71
|
+
import { baseBookingItemSchema as va, baseBookingSchema as La, baseBookingStateSchema as Na } from "./chunks/booking-engine/dist/schemas/base-booking-D9k8ehGi.js";
|
|
72
|
+
import { richTextJsonDocSchema as Va, richTextSchema as wa, richTextVersionSchema as za } from "./chunks/booking-engine/dist/schemas/rich-text-CqXhNDN3.js";
|
|
73
|
+
import { currencyCodeSchema as Ka, currencyMinorUnitDigits as Wa, majorToMinor as Ga, minorToMajor as Ja, moneyMinorSchema as Ya, signedMoneyMinorSchema as ja } from "./chunks/booking-engine/dist/schemas/money-Dy4b9loa.js";
|
|
74
|
+
import { isoDateSchema as Xa, shopConfigurationSchema as Za, shopExtraTimeSlotRuleSchema as $a, shopOpeningDayIndexSchema as ec, shopOpeningDaySchema as oc, shopOpeningHoursOverrideSchema as tc, shopOpeningHoursPeriodSchema as rc, shopOpeningSlotSchema as ac, timeOfDaySchema as cc } from "./chunks/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js";
|
|
75
|
+
import { fulfillmentModeSchema as ic, publicBookingEngineConfigurationSchema as mc, publicCheckoutConfigurationSchema as Sc, publicCheckoutDynamicOptionsSchema as sc } from "./chunks/booking-engine/dist/schemas/public-booking-engine-configuration-DKoak4s5.js";
|
|
76
|
+
import { DEFAULT_PAYMENT_POLICIES as lc, paymentPoliciesSchema as fc } from "./chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js";
|
|
77
|
+
import { BookingEndDateField as hc } from "./components/BookingPeriodSelector/components/BookingEndDateField.js";
|
|
78
|
+
import { BookingEndTimeField as gc } from "./components/BookingPeriodSelector/components/BookingEndTimeField.js";
|
|
79
|
+
import { BookingMobileDateDrawer as Pc } from "./components/BookingPeriodSelector/components/BookingMobileDateDrawer.js";
|
|
80
|
+
import { BookingPeriodProvider as Rc, useBookingPeriod as Cc } from "./components/BookingPeriodSelector/BookingPeriodContext.js";
|
|
81
|
+
import { BookingStartDateField as Ac } from "./components/BookingPeriodSelector/components/BookingStartDateField.js";
|
|
82
|
+
import { BookingStartTimeField as bc } from "./components/BookingPeriodSelector/components/BookingStartTimeField.js";
|
|
83
83
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
dr as ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE,
|
|
85
|
+
Qo as AboutSection,
|
|
86
86
|
M as BOOKING_SEARCH_KEYS,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
87
|
+
gt as Badge,
|
|
88
|
+
hc as BookingEndDateField,
|
|
89
|
+
gc as BookingEndTimeField,
|
|
90
|
+
zo as BookingFlowSteps,
|
|
91
|
+
Pc as BookingMobileDateDrawer,
|
|
92
|
+
Rc as BookingPeriodProvider,
|
|
93
|
+
Vo as BookingPeriodSelector,
|
|
94
|
+
Ac as BookingStartDateField,
|
|
95
|
+
bc as BookingStartTimeField,
|
|
96
|
+
xt as Button,
|
|
97
|
+
ae as CATALOG_PRODUCT_BASE_RATE_UNSET,
|
|
98
|
+
Dt as Card,
|
|
99
|
+
At as CardAction,
|
|
100
|
+
Ot as CardContent,
|
|
101
|
+
bt as CardDescription,
|
|
102
|
+
Et as CardFooter,
|
|
103
|
+
Bt as CardHeader,
|
|
104
|
+
kt as CardTitle,
|
|
105
|
+
Go as ContactSection,
|
|
106
|
+
st as ContractSaleDocument,
|
|
107
|
+
lc as DEFAULT_PAYMENT_POLICIES,
|
|
108
|
+
y as DEFAULT_STOREFRONT_PRESET,
|
|
109
|
+
gr as DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE,
|
|
110
|
+
_o as DelayedPlaceholder,
|
|
111
|
+
Mo as DelayedReveal,
|
|
112
|
+
Ko as DeliveryAddressSelector,
|
|
113
|
+
ko as Footer,
|
|
114
|
+
Ht as Form,
|
|
115
|
+
Kt as FormControl,
|
|
116
|
+
Wt as FormDescription,
|
|
117
|
+
Gt as FormField,
|
|
118
|
+
Jt as FormItem,
|
|
119
|
+
Yt as FormLabel,
|
|
120
|
+
jt as FormMessage,
|
|
121
|
+
Tr as GET_CONTRACT_SALE_DOCUMENT_ROUTE,
|
|
122
|
+
Io as Header,
|
|
123
|
+
wt as Input,
|
|
124
|
+
Vr as Label,
|
|
125
|
+
Eo as Layout,
|
|
126
|
+
sa as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND,
|
|
127
|
+
ua as PRODUCT_VARIANT_CODE_MAX_LENGTH,
|
|
128
|
+
vo as PlatformFooter,
|
|
129
|
+
No as PoweredByLoczerBadge,
|
|
130
|
+
nt as ProductPriceBadge,
|
|
131
|
+
mt as ProductWarningNotice,
|
|
132
|
+
ke as ROUTE,
|
|
133
|
+
Nt as RadioGroup,
|
|
134
|
+
qt as RadioGroupItem,
|
|
135
|
+
to as STOREFRONT_AVAILABILITY_ROUTE,
|
|
136
|
+
Le as STOREFRONT_CHECKOUT_SUBMIT_ROUTE,
|
|
137
|
+
go as STOREFRONT_IMAGE_ROUTE,
|
|
137
138
|
I as STOREFRONT_PRESETS,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
139
|
+
Ke as STOREFRONT_PRODUCTS_ROUTE,
|
|
140
|
+
Ro as STOREFRONT_TIME_SLOTS_ROUTE,
|
|
141
|
+
zr as Select,
|
|
142
|
+
Hr as SelectContent,
|
|
143
|
+
Kr as SelectGroup,
|
|
144
|
+
Wr as SelectIcon,
|
|
145
|
+
Gr as SelectItem,
|
|
146
|
+
Jr as SelectItemIndicator,
|
|
147
|
+
Yr as SelectItemText,
|
|
148
|
+
jr as SelectLabel,
|
|
149
|
+
Qr as SelectScrollDownButton,
|
|
150
|
+
Xr as SelectScrollUpButton,
|
|
151
|
+
Zr as SelectSeparator,
|
|
152
|
+
$r as SelectTrigger,
|
|
153
|
+
ea as SelectValue,
|
|
154
|
+
tt as StepSectionTitle,
|
|
155
|
+
at as StorefrontCartPanel,
|
|
155
156
|
$ as StorefrontCartProvider,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
157
|
+
U as TIME_OPTIONS,
|
|
158
|
+
Yo as TestimonialsSection,
|
|
159
|
+
Zt as Textarea,
|
|
160
|
+
Zo as WhatsAppFloatingButton,
|
|
161
|
+
Pr as acceptContractSaleDocumentRequestSchema,
|
|
162
|
+
xr as acceptContractSaleDocumentResponseSchema,
|
|
163
|
+
er as accessories,
|
|
164
|
+
la as accessoryProductSchema,
|
|
165
|
+
v as applyBookingParamsToSearch,
|
|
166
|
+
Tt as badgeVariants,
|
|
167
|
+
_a as baseAssetSchema,
|
|
168
|
+
Ma as baseAssetStatusSchema,
|
|
169
|
+
va as baseBookingItemSchema,
|
|
170
|
+
La as baseBookingSchema,
|
|
171
|
+
Na as baseBookingStateSchema,
|
|
172
|
+
fa as bikeProductSchema,
|
|
173
|
+
tr as bikes,
|
|
174
|
+
ta as bookingCustomerInputSchema,
|
|
175
|
+
ra as bookingDeliveryOptionSchema,
|
|
176
|
+
aa as bookingScheduleInputSchema,
|
|
177
|
+
xe as buildDailyPriceRows,
|
|
178
|
+
Re as buildPriceTierLabels,
|
|
179
|
+
ro as buildStorefrontAvailabilityKey,
|
|
179
180
|
te as buildStorefrontCartSummary,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
181
|
+
To as buildStorefrontImageUrl,
|
|
182
|
+
ce as buildStorefrontProductSlug,
|
|
183
|
+
_e as buildWhatsAppHref,
|
|
184
|
+
Rt as buttonVariants,
|
|
185
|
+
Ce as calculateDailyPriceForQuantity,
|
|
186
|
+
ca as cartItemInputSchema,
|
|
187
|
+
lt as cn,
|
|
188
|
+
ne as compareCatalogProducts,
|
|
189
|
+
ie as compareStorefrontAccessoryProducts,
|
|
190
|
+
me as compareStorefrontBikeProducts,
|
|
191
|
+
Rr as contractSaleDocumentAcceptanceInputSchema,
|
|
192
|
+
ar as contractSaleDocumentAcceptanceLevelSchema,
|
|
193
|
+
Cr as contractSaleDocumentAcceptanceRecordInputSchema,
|
|
194
|
+
cr as contractSaleDocumentAcceptanceRecordSchema,
|
|
195
|
+
nr as contractSaleDocumentAcceptanceSchema,
|
|
196
|
+
ir as contractSaleDocumentAddressSchema,
|
|
197
|
+
Dr as contractSaleDocumentApiAcceptanceRecordSchema,
|
|
198
|
+
Ar as contractSaleDocumentApiAcceptanceSchema,
|
|
199
|
+
Or as contractSaleDocumentApiSchema,
|
|
200
|
+
br as contractSaleDocumentApiSignatureSchema,
|
|
201
|
+
mr as contractSaleDocumentContactSchema,
|
|
202
|
+
Sr as contractSaleDocumentKindSchema,
|
|
203
|
+
sr as contractSaleDocumentLanguageCodeSchema,
|
|
204
|
+
ur as contractSaleDocumentLanguageSchema,
|
|
205
|
+
lr as contractSaleDocumentLineItemSchema,
|
|
206
|
+
Er as contractSaleDocumentReferenceSchema,
|
|
207
|
+
Br as contractSaleDocumentReferenceTypeSchema,
|
|
208
|
+
fr as contractSaleDocumentSchema,
|
|
209
|
+
kr as contractSaleDocumentSignatureInputSchema,
|
|
210
|
+
pr as contractSaleDocumentSignatureSchema,
|
|
211
|
+
na as createBookingInputBaseSchema,
|
|
212
|
+
ia as createBookingInputSchema,
|
|
211
213
|
L as createBookingPeriodConfigFromBookingEngineConfiguration,
|
|
212
214
|
N as createBookingPeriodConfigFromStorefrontConfiguration,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
Aa as createLocalizedStringEntry,
|
|
216
|
+
Ka as currencyCodeSchema,
|
|
217
|
+
Wa as currencyMinorUnitDigits,
|
|
218
|
+
ao as doesStorefrontAvailabilityDisplaySoldOut,
|
|
219
|
+
yr as downloadContractSaleDocumentPdfRequestSchema,
|
|
220
|
+
pa as eBikeProductSchema,
|
|
221
|
+
Se as findStorefrontProduct,
|
|
222
|
+
se as findStorefrontProductBySlug,
|
|
223
|
+
Oe as formatPriceMinor,
|
|
224
|
+
De as formatStorefrontPriceMinor,
|
|
225
|
+
ic as fulfillmentModeSchema,
|
|
226
|
+
be as getAvailabilityVariant,
|
|
225
227
|
q as getBookingDurationLabel,
|
|
226
228
|
V as getBookingDurationMinutes,
|
|
227
229
|
w as getBookingParamsFromSearch,
|
|
228
230
|
z as getBookingSessionStorageKey,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
+
ue as getCatalogProductBaseRateMinor,
|
|
232
|
+
le as getCatalogProductPaginationSort,
|
|
233
|
+
fe as getCatalogProductSortFieldForPriceUnit,
|
|
234
|
+
Ir as getContractSaleDocumentRequestSchema,
|
|
235
|
+
Fr as getContractSaleDocumentResponseSchema,
|
|
231
236
|
H as getDefaultBookingParams,
|
|
232
237
|
K as getDefaultBookingParamsForStorefrontConfiguration,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
pt as getLocalizedEntry,
|
|
239
|
+
Oa as getLocalizedStringValue,
|
|
240
|
+
ht as getLocalizedValue,
|
|
241
|
+
Ee as getMinDayPriceMinor,
|
|
242
|
+
co as getStorefrontAvailabilityIssue,
|
|
243
|
+
no as getStorefrontAvailabilityStatus,
|
|
244
|
+
pe as getStorefrontBaseDailyRateMinor,
|
|
245
|
+
he as getStorefrontCheckoutProductId,
|
|
241
246
|
F as getStorefrontPreset,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
247
|
+
de as getStorefrontRepresentedVariantId,
|
|
248
|
+
ha as isProductVariantCodeIdentifierKind,
|
|
249
|
+
io as isStorefrontAvailabilityInsufficient,
|
|
250
|
+
Xa as isoDateSchema,
|
|
251
|
+
It as loader,
|
|
252
|
+
ba as localizedStringArraySchema,
|
|
253
|
+
Ea as localizedStringEntrySchema,
|
|
254
|
+
Ba as localizedStringSchema,
|
|
255
|
+
Ga as majorToMinor,
|
|
256
|
+
Ja as minorToMajor,
|
|
257
|
+
Ya as moneyMinorSchema,
|
|
258
|
+
fc as paymentPoliciesSchema,
|
|
254
259
|
W as pickBookingSearchParams,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
ya as priceSchema,
|
|
261
|
+
Ia as priceUnitSchema,
|
|
262
|
+
da as productKindSchema,
|
|
263
|
+
ga as productSchema,
|
|
264
|
+
Ta as productStorefrontDisplayModeSchema,
|
|
265
|
+
Pa as productVariantAttributeSchema,
|
|
266
|
+
xa as productVariantCodeSchema,
|
|
267
|
+
Ra as productVariantIdentifierSchema,
|
|
268
|
+
Ca as productVariantSchema,
|
|
269
|
+
mo as publicAvailabilityDisplayModeSchema,
|
|
270
|
+
mc as publicBookingEngineConfigurationSchema,
|
|
271
|
+
Sc as publicCheckoutConfigurationSchema,
|
|
272
|
+
sc as publicCheckoutDynamicOptionsSchema,
|
|
268
273
|
G as readBookingSearchParamsFromSessionStorage,
|
|
269
274
|
J as readBookingSearchParamsFromStorage,
|
|
270
|
-
|
|
275
|
+
ye as requestSchema,
|
|
271
276
|
Y as resolveBookingSearchParams,
|
|
272
277
|
j as resolveBookingSearchParamsFromSessionStorage,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
278
|
+
Me as resolveStorefrontWhatsAppContact,
|
|
279
|
+
Ue as resolveStorefrontWhatsAppHref,
|
|
280
|
+
Ie as responseSchema,
|
|
281
|
+
Va as richTextJsonDocSchema,
|
|
282
|
+
wa as richTextSchema,
|
|
283
|
+
za as richTextVersionSchema,
|
|
284
|
+
Za as shopConfigurationSchema,
|
|
285
|
+
$a as shopExtraTimeSlotRuleSchema,
|
|
286
|
+
ec as shopOpeningDayIndexSchema,
|
|
287
|
+
oc as shopOpeningDaySchema,
|
|
288
|
+
tc as shopOpeningHoursOverrideSchema,
|
|
289
|
+
rc as shopOpeningHoursPeriodSchema,
|
|
290
|
+
ac as shopOpeningSlotSchema,
|
|
291
|
+
So as shouldBlockStorefrontUnavailableItem,
|
|
292
|
+
ja as signedMoneyMinorSchema,
|
|
293
|
+
so as storefrontAvailabilityProductSchema,
|
|
294
|
+
uo as storefrontAvailabilityRequestSchema,
|
|
295
|
+
lo as storefrontAvailabilityResponseSchema,
|
|
296
|
+
fo as storefrontAvailabilityScheduleSchema,
|
|
292
297
|
p as storefrontCheckoutModeSchema,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
+
Ne as storefrontCheckoutSubmitDeliveryRefinement,
|
|
299
|
+
qe as storefrontCheckoutSubmitItemSchema,
|
|
300
|
+
Ve as storefrontCheckoutSubmitRequestBaseSchema,
|
|
301
|
+
we as storefrontCheckoutSubmitRequestSchema,
|
|
302
|
+
ze as storefrontCheckoutSubmitResponseSchema,
|
|
298
303
|
h as storefrontConfigurationSchema,
|
|
299
304
|
d as storefrontContentSchema,
|
|
300
|
-
|
|
305
|
+
Mr as storefrontEn,
|
|
301
306
|
g as storefrontFaqItemSchema,
|
|
302
307
|
T as storefrontFaqSchema,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
308
|
+
vr as storefrontFr,
|
|
309
|
+
P as storefrontFulfillmentModeSchema,
|
|
310
|
+
Po as storefrontImageRequestSchema,
|
|
311
|
+
x as storefrontLocalizedRichTextSchema,
|
|
312
|
+
R as storefrontModalMessageSchema,
|
|
313
|
+
C as storefrontModulesSchema,
|
|
314
|
+
We as storefrontProductsRequestSchema,
|
|
315
|
+
Ge as storefrontProductsResponseSchema,
|
|
316
|
+
Je as storefrontPublicAccessoryProductSchema,
|
|
317
|
+
po as storefrontPublicAvailabilityRecordSchema,
|
|
318
|
+
Ye as storefrontPublicBikeAvailabilityStatusSchema,
|
|
319
|
+
je as storefrontPublicBikeProductSchema,
|
|
320
|
+
Qe as storefrontPublicProductDisplayModeSchema,
|
|
321
|
+
Xe as storefrontPublicProductPriceSchema,
|
|
322
|
+
Ze as storefrontPublicProductVariantAttributeSchema,
|
|
323
|
+
$e as storefrontPublicProductVariantIdentifierSchema,
|
|
324
|
+
eo as storefrontPublicProductVariantSchema,
|
|
325
|
+
D as storefrontReviewsModuleSchema,
|
|
321
326
|
A as storefrontRichTextSchema,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
327
|
+
Nr as storefrontRoutes,
|
|
328
|
+
O as storefrontSettingsSchema,
|
|
329
|
+
b as storefrontShopSchema,
|
|
330
|
+
E as storefrontStatusSchema,
|
|
331
|
+
Co as storefrontTimeSlotJourneySchema,
|
|
332
|
+
Do as storefrontTimeSlotSchema,
|
|
333
|
+
Ao as storefrontTimeSlotsRequestSchema,
|
|
334
|
+
Oo as storefrontTimeSlotsResponseSchema,
|
|
335
|
+
B as storefrontWorkspaceSchema,
|
|
336
|
+
cc as timeOfDaySchema,
|
|
337
|
+
ge as toStorefrontAccessoryProducts,
|
|
338
|
+
Te as toStorefrontBikeProducts,
|
|
339
|
+
Cc as useBookingPeriod,
|
|
340
|
+
Qt as useFormField,
|
|
341
|
+
Ft as useOptionalStorefront,
|
|
342
|
+
_t as useStorefront,
|
|
338
343
|
ee as useStorefrontCart,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
+
Mt as useStorefrontConfig,
|
|
345
|
+
Ut as useStorefrontProducts,
|
|
346
|
+
vt as useStorefrontWorkspaceLanguage,
|
|
347
|
+
et as useWhatsAppFloatingButton,
|
|
348
|
+
ma as validateBookingDeliveryAddress,
|
|
344
349
|
Q as writeBookingSearchParamsToSessionStorage,
|
|
345
350
|
X as writeBookingSearchParamsToStorage
|
|
346
351
|
};
|
package/dist/lib/products.d.ts
CHANGED
|
@@ -7,6 +7,13 @@ export type AccessoryProduct = StorefrontPublicAccessoryProduct & {
|
|
|
7
7
|
kind: "accessory";
|
|
8
8
|
};
|
|
9
9
|
export type StorefrontProduct = BikeProduct | AccessoryProduct;
|
|
10
|
+
export declare const CATALOG_PRODUCT_BASE_RATE_UNSET = -1;
|
|
11
|
+
export type CatalogProductSortPriceUnit = StorefrontPublicProductPrice["unit"];
|
|
12
|
+
export type CatalogProductSortField = "kind" | "assetRelScore" | "baseHourlyRateMinor" | "baseHalfDayRateMinor" | "baseDailyRateMinor" | "baseWeeklyRateMinor" | "baseMonthlyRateMinor" | "externalId";
|
|
13
|
+
export type CatalogProductPaginationSort = Array<{
|
|
14
|
+
field: CatalogProductSortField;
|
|
15
|
+
order: "asc" | "desc";
|
|
16
|
+
}>;
|
|
10
17
|
type SortableStorefrontProduct = {
|
|
11
18
|
id: string;
|
|
12
19
|
prices?: StorefrontPublicProductPrice[];
|
|
@@ -15,6 +22,16 @@ type SortableStorefrontProduct = {
|
|
|
15
22
|
type SortableStorefrontBikeProduct = SortableStorefrontProduct & {
|
|
16
23
|
kind?: StorefrontPublicBikeProduct["kind"];
|
|
17
24
|
};
|
|
25
|
+
type SortableCatalogProduct = {
|
|
26
|
+
id?: string;
|
|
27
|
+
externalId?: string;
|
|
28
|
+
kind?: string;
|
|
29
|
+
prices?: StorefrontPublicProductPrice[];
|
|
30
|
+
assetRelScore?: number;
|
|
31
|
+
};
|
|
32
|
+
export type CatalogProductSortOptions = {
|
|
33
|
+
priceUnit?: CatalogProductSortPriceUnit;
|
|
34
|
+
};
|
|
18
35
|
export type StorefrontProductsCollections = {
|
|
19
36
|
bikes: BikeProduct[];
|
|
20
37
|
accessories: AccessoryProduct[];
|
|
@@ -24,9 +41,13 @@ export declare const buildStorefrontProductSlug: ({ id, productShortCode, name,
|
|
|
24
41
|
productShortCode?: string | null;
|
|
25
42
|
name?: LocalizedString;
|
|
26
43
|
}) => string;
|
|
44
|
+
export declare function getCatalogProductSortFieldForPriceUnit(unit: CatalogProductSortPriceUnit): CatalogProductSortField;
|
|
45
|
+
export declare function getCatalogProductPaginationSort(priceUnit: CatalogProductSortPriceUnit): CatalogProductPaginationSort;
|
|
46
|
+
export declare function getCatalogProductBaseRateMinor(prices: StorefrontPublicProductPrice[] | undefined, priceUnit?: CatalogProductSortPriceUnit): number;
|
|
27
47
|
export declare function getStorefrontBaseDailyRateMinor(prices: StorefrontPublicProductPrice[] | undefined): number;
|
|
28
|
-
export declare function
|
|
29
|
-
export declare function
|
|
48
|
+
export declare function compareCatalogProducts<T extends SortableCatalogProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
|
|
49
|
+
export declare function compareStorefrontBikeProducts<T extends SortableStorefrontBikeProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
|
|
50
|
+
export declare function compareStorefrontAccessoryProducts<T extends SortableStorefrontProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
|
|
30
51
|
export declare const toStorefrontBikeProducts: (bikes: StorefrontPublicBikeProduct[]) => BikeProduct[];
|
|
31
52
|
export declare const toStorefrontAccessoryProducts: (accessories: StorefrontPublicAccessoryProduct[]) => AccessoryProduct[];
|
|
32
53
|
export declare const findStorefrontProduct: (id: string, products: StorefrontProductsCollections) => StorefrontProduct | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/lib/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AACjG,MAAM,MAAM,gBAAgB,GAAG,gCAAgC,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAA;AACvF,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/lib/products.ts"],"names":[],"mappings":"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"}
|
package/dist/lib/products.js
CHANGED
|
@@ -1,58 +1,91 @@
|
|
|
1
|
-
const
|
|
1
|
+
const P = -1, k = {
|
|
2
|
+
hour: "baseHourlyRateMinor",
|
|
3
|
+
half_day: "baseHalfDayRateMinor",
|
|
4
|
+
day: "baseDailyRateMinor",
|
|
5
|
+
week: "baseWeeklyRateMinor",
|
|
6
|
+
month: "baseMonthlyRateMinor"
|
|
7
|
+
}, S = /[\u0300-\u036f]/g, b = /[^a-z0-9]+/g, R = /^-+|-+$/g, s = (e) => e.normalize("NFKD").replace(S, "").toLowerCase().replace(b, "-").replace(R, ""), y = (e) => {
|
|
2
8
|
const t = e?.en?.value.trim();
|
|
3
9
|
return t || (Object.values(e ?? {}).find((r) => r.value.trim().length > 0)?.value.trim() ?? "");
|
|
4
|
-
},
|
|
10
|
+
}, m = ({
|
|
5
11
|
id: e,
|
|
6
12
|
productShortCode: t,
|
|
7
13
|
name: r
|
|
8
14
|
}) => {
|
|
9
|
-
const o =
|
|
10
|
-
return `product-${[o, n].filter((
|
|
11
|
-
};
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const o = s(typeof t == "string" ? t.trim() : ""), n = s(y(r)), c = s(e);
|
|
16
|
+
return `product-${[o, n].filter((i) => i.length > 0).join("-") || c || "item"}`;
|
|
17
|
+
}, u = (e) => e === "e-bike" ? 0 : e === "bike" ? 1 : e === "accessory" ? 2 : 3, l = (e) => e.externalId?.trim() || e.id?.trim() || "";
|
|
18
|
+
function g(e) {
|
|
19
|
+
return k[e];
|
|
20
|
+
}
|
|
21
|
+
function _(e) {
|
|
22
|
+
return [
|
|
23
|
+
{ field: "kind", order: "desc" },
|
|
24
|
+
{ field: "assetRelScore", order: "desc" },
|
|
25
|
+
{ field: g(e), order: "desc" },
|
|
26
|
+
{ field: "externalId", order: "asc" }
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
function d(e, t = "day") {
|
|
30
|
+
const r = e?.find((o) => o.unit === t && o.quantity === 1);
|
|
31
|
+
return r ? r.value : -1;
|
|
32
|
+
}
|
|
33
|
+
function p(e) {
|
|
34
|
+
return d(e, "day");
|
|
35
|
+
}
|
|
36
|
+
function f(e, t, r = {}) {
|
|
37
|
+
const o = u(e.kind), n = u(t.kind);
|
|
38
|
+
if (o !== n)
|
|
39
|
+
return o - n;
|
|
40
|
+
const c = (t.assetRelScore ?? 0) - (e.assetRelScore ?? 0);
|
|
41
|
+
if (c !== 0) return c;
|
|
42
|
+
const a = r.priceUnit ?? "day", i = d(t.prices, a) - d(e.prices, a);
|
|
43
|
+
return i !== 0 ? i : l(e).localeCompare(l(t));
|
|
15
44
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const c = s(t.prices) - s(e.prices);
|
|
23
|
-
return c !== 0 ? c : e.id.localeCompare(t.id);
|
|
45
|
+
function A(e, t, r = {}) {
|
|
46
|
+
return f(
|
|
47
|
+
{ ...e, kind: e.kind === "e-bike" ? "e-bike" : "bike" },
|
|
48
|
+
{ ...t, kind: t.kind === "e-bike" ? "e-bike" : "bike" },
|
|
49
|
+
r
|
|
50
|
+
);
|
|
24
51
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
52
|
+
function C(e, t, r = {}) {
|
|
53
|
+
return f(
|
|
54
|
+
{ ...e, kind: "accessory" },
|
|
55
|
+
{ ...t, kind: "accessory" },
|
|
56
|
+
r
|
|
57
|
+
);
|
|
30
58
|
}
|
|
31
|
-
const
|
|
59
|
+
const E = (e) => e.map((t) => ({
|
|
32
60
|
...t,
|
|
33
61
|
kind: t.kind === "e-bike" ? "e-bike" : "bike"
|
|
34
|
-
})),
|
|
62
|
+
})), T = (e) => e.map((t) => ({
|
|
35
63
|
...t,
|
|
36
64
|
kind: "accessory"
|
|
37
|
-
})),
|
|
65
|
+
})), I = (e, t) => {
|
|
38
66
|
const r = t.bikes.find((n) => n.id === e);
|
|
39
67
|
return r || (t.accessories.find((n) => n.id === e) ?? null);
|
|
40
|
-
},
|
|
68
|
+
}, M = (e, t) => {
|
|
41
69
|
const r = t.bikes.find((n) => n.slug === e);
|
|
42
70
|
return r || (t.accessories.find((n) => n.slug === e) ?? null);
|
|
43
|
-
},
|
|
71
|
+
}, B = (e) => e.checkoutProductId?.trim() || e.id, D = (e) => {
|
|
44
72
|
const t = e.representedVariantId?.trim();
|
|
45
73
|
return t || void 0;
|
|
46
74
|
};
|
|
47
75
|
export {
|
|
48
|
-
|
|
49
|
-
m as
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
P as CATALOG_PRODUCT_BASE_RATE_UNSET,
|
|
77
|
+
m as buildStorefrontProductSlug,
|
|
78
|
+
f as compareCatalogProducts,
|
|
79
|
+
C as compareStorefrontAccessoryProducts,
|
|
80
|
+
A as compareStorefrontBikeProducts,
|
|
81
|
+
I as findStorefrontProduct,
|
|
82
|
+
M as findStorefrontProductBySlug,
|
|
83
|
+
d as getCatalogProductBaseRateMinor,
|
|
84
|
+
_ as getCatalogProductPaginationSort,
|
|
85
|
+
g as getCatalogProductSortFieldForPriceUnit,
|
|
86
|
+
p as getStorefrontBaseDailyRateMinor,
|
|
87
|
+
B as getStorefrontCheckoutProductId,
|
|
88
|
+
D as getStorefrontRepresentedVariantId,
|
|
89
|
+
T as toStorefrontAccessoryProducts,
|
|
90
|
+
E as toStorefrontBikeProducts
|
|
58
91
|
};
|