@loczer/storefront-sdk 0.182.0 → 0.184.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 +18 -15
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +24 -34
- package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
- package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-9vM8GCrc.js → cart-inputs-j1yWfJxO.js} +8 -5
- package/dist/chunks/booking-engine/dist/schemas-DftrSnTE.js +13 -0
- package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
- package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
- package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
- package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
- package/dist/components/AboutSection/index.d.ts +1 -6
- package/dist/components/AboutSection/index.d.ts.map +1 -1
- package/dist/components/AboutSection/index.js +43 -39
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +152 -148
- package/dist/components/ContactSection/index.d.ts +1 -3
- package/dist/components/ContactSection/index.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +222 -164
- package/dist/components/Footer/index.d.ts +3 -4
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +98 -69
- package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
- package/dist/components/FulfillmentSection/index.js +17 -16
- package/dist/components/Header/index.d.ts +1 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +77 -72
- package/dist/components/Layout/index.d.ts +3 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +45 -47
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +68 -60
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +159 -150
- package/dist/index.js +64 -64
- package/dist/lib/booking.d.ts +3 -0
- package/dist/lib/booking.d.ts.map +1 -1
- package/dist/lib/booking.js +76 -74
- package/dist/lib/cart.d.ts +4 -1
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +64 -40
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +4 -3
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +36 -36
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +20 -9
- package/dist/lib/storefrontAddress.d.ts +5 -0
- package/dist/lib/storefrontAddress.d.ts.map +1 -0
- package/dist/lib/storefrontAddress.js +24 -0
- package/dist/lib/storefrontAvailability.d.ts +6 -6
- package/dist/lib/storefrontContact.d.ts +10 -0
- package/dist/lib/storefrontContact.d.ts.map +1 -0
- package/dist/lib/storefrontContact.js +24 -0
- package/dist/lib/storefrontMissingValues.d.ts +5 -0
- package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
- package/dist/lib/storefrontMissingValues.js +4 -0
- package/dist/lib/storefrontProducts.d.ts +23 -21
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +7 -5
- package/dist/lib/whatsapp.d.ts +8 -6
- package/dist/lib/whatsapp.d.ts.map +1 -1
- package/dist/lib/whatsapp.js +16 -43
- package/dist/pages/BookingPage.js +36 -36
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +126 -128
- package/dist/pages/ProductPage.js +160 -160
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -12
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +3 -2
- package/dist/ui/radio-group.d.ts +1 -1
- package/package.json +7 -6
- package/dist/chunks/booking-engine/dist/schemas-BNlwu75Z.js +0 -13
- package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
- package/dist/data/config.d.ts +0 -15
- package/dist/data/config.d.ts.map +0 -1
- package/dist/data/config.js +0 -24
- package/dist/static/strings.d.ts +0 -2
- package/dist/static/strings.d.ts.map +0 -1
- package/dist/static/strings.js +0 -4
package/dist/index.js
CHANGED
|
@@ -2,79 +2,79 @@
|
|
|
2
2
|
import { createLocalizedStringEntry as e, getLocalizedStringValue as t, localizedStringArraySchema as n, localizedStringEntrySchema as r, localizedStringSchema as i } from "./chunks/booking-engine/dist/models/LocalizedString-D_TRgAdr.js";
|
|
3
3
|
import { currencyCodeSchema as a, currencyMinorUnitDigits as o, majorToMinor as s, minorToMajor as c, moneyMinorSchema as l, signedMoneyMinorSchema as u } from "./chunks/booking-engine/dist/schemas/money-CVoCY4of.js";
|
|
4
4
|
import { priceSchema as d, priceUnitSchema as f } from "./chunks/booking-engine/dist/models/Price-DCAgqkKh.js";
|
|
5
|
-
import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productKindSchema as y, productSchema as b, productStorefrontDisplayModeSchema as x, productVariantAttributeSchema as S, productVariantCodeSchema as C, productVariantIdentifierSchema as w, productVariantSchema as T } from "./chunks/booking-engine/dist/models/Product.shared-
|
|
5
|
+
import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productKindSchema as y, productSchema as b, productStorefrontDisplayModeSchema as x, productVariantAttributeSchema as S, productVariantCodeSchema as C, productVariantIdentifierSchema as w, productVariantSchema as T } from "./chunks/booking-engine/dist/models/Product.shared-CTuk4fiR.js";
|
|
6
6
|
import { richTextJsonDocSchema as E, richTextSchema as D, richTextVersionSchema as O } from "./chunks/booking-engine/dist/schemas/rich-text-DTRh7U3z.js";
|
|
7
7
|
import { isoDateSchema as k, shopConfigurationSchema as A, shopExtraTimeSlotRuleSchema as j, shopOpeningDayIndexSchema as M, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as P, shopOpeningHoursPeriodSchema as F, shopOpeningSlotSchema as I, timeOfDaySchema as L } from "./chunks/booking-engine/dist/schemas/shop-opening-hours-BlLD1gfz.js";
|
|
8
8
|
import { DEFAULT_CANCELLATION_POLICY as R, DEFAULT_PAYMENT_POLICIES as z, cancellationPolicySchema as B, cancellationPolicyTierSchema as V, paymentPoliciesSchema as H } from "./chunks/booking-engine/dist/schemas/booking-engine-configuration-D02MRF9U.js";
|
|
9
9
|
import { fulfillmentModeSchema as U, publicBookingEngineConfigurationSchema as W, publicCheckoutConfigurationSchema as G, publicCheckoutDynamicOptionsSchema as K } from "./chunks/booking-engine/dist/schemas/public-booking-engine-configuration-BnJ_H-p1.js";
|
|
10
|
-
import {
|
|
11
|
-
import { baseAssetSchema as
|
|
12
|
-
import { baseBookingItemSchema as
|
|
13
|
-
import "./chunks/booking-engine/dist/schemas-
|
|
14
|
-
import { storefrontCheckoutModeSchema as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { StorefrontCartProvider as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { buildWhatsAppHref as
|
|
25
|
-
import { ROUTE as
|
|
26
|
-
import { ROUTE as
|
|
27
|
-
import { ROUTE as
|
|
28
|
-
import { ROUTE as
|
|
29
|
-
import { ROUTE as
|
|
30
|
-
import { Footer as
|
|
31
|
-
import { Badge as
|
|
32
|
-
import { Button as
|
|
33
|
-
import { Header as
|
|
34
|
-
import { storefront as
|
|
35
|
-
import { storefront as
|
|
36
|
-
import { PoweredByLoczerBadge as
|
|
37
|
-
import { PlatformFooter as
|
|
38
|
-
import { useWhatsAppFloatingButton as
|
|
39
|
-
import { WhatsAppFloatingButton as
|
|
10
|
+
import { DEFAULT_BOOKING_DELIVERY_OPTION as q, bookingCustomerInputSchema as J, bookingDeliveryOptionSchema as Y, bookingScheduleInputSchema as X, cartItemInputSchema as Z, createBookingInputBaseSchema as Q, createBookingInputSchema as $, resolveBookingDeliveryOption as ee, validateBookingDeliveryAddress as te } from "./chunks/booking-engine/dist/schemas/cart-inputs-j1yWfJxO.js";
|
|
11
|
+
import { baseAssetSchema as ne, baseAssetStatusSchema as re } from "./chunks/booking-engine/dist/schemas/base-asset-B_Dm8_Vk.js";
|
|
12
|
+
import { baseBookingItemSchema as ie, baseBookingSchema as ae, baseBookingStateSchema as oe } from "./chunks/booking-engine/dist/schemas/base-booking-DW8AEPKo.js";
|
|
13
|
+
import "./chunks/booking-engine/dist/schemas-DftrSnTE.js";
|
|
14
|
+
import { storefrontCheckoutModeSchema as se, storefrontConfigurationSchema as ce, storefrontContentSchema as le, storefrontFaqItemSchema as ue, storefrontFaqSchema as de, storefrontFulfillmentModeSchema as fe, storefrontLocalizedRichTextSchema as pe, storefrontModalMessageSchema as me, storefrontModulesSchema as he, storefrontReviewsModuleSchema as ge, storefrontRichTextSchema as _e, storefrontSettingsSchema as ve, storefrontShopSchema as ye, storefrontStatusSchema as be, storefrontWorkspaceSchema as xe } from "./storefrontSchemas.js";
|
|
15
|
+
import { BOOKING_SEARCH_KEYS as Se, TIME_OPTIONS as Ce, applyBookingParamsToSearch as we, createBookingPeriodConfigFromBookingEngineConfiguration as Te, createBookingPeriodConfigFromShopConfiguration as Ee, createBookingPeriodConfigFromStorefrontConfiguration as De, getBookingDurationLabel as Oe, getBookingDurationMinutes as ke, getBookingParamsFromSearch as Ae, getBookingSessionStorageKey as je, getDefaultBookingParams as Me, getDefaultBookingParamsForStorefrontConfiguration as Ne, pickBookingSearchParams as Pe, readBookingSearchParamsFromSessionStorage as Fe, readBookingSearchParamsFromStorage as Ie, resolveBookingSearchParams as Le, resolveBookingSearchParamsFromSessionStorage as Re, writeBookingSearchParamsToSessionStorage as ze, writeBookingSearchParamsToStorage as Be } from "./lib/booking.js";
|
|
16
|
+
import { CATALOG_PRODUCT_BASE_RATE_UNSET as Ve, buildStorefrontProductSlug as He, buildVariantStorefrontProductId as Ue, compareCatalogProducts as We, compareStorefrontAccessoryProducts as Ge, compareStorefrontBikeProducts as Ke, findStorefrontProduct as qe, findStorefrontProductBySlug as Je, getCatalogProductBaseRateMinor as Ye, getCatalogProductPaginationSort as Xe, getCatalogProductSortFieldForPriceUnit as Ze, getStorefrontBaseDailyRateMinor as Qe, getStorefrontCheckoutProductId as $e, getStorefrontRepresentedVariantId as et, toStorefrontAccessoryProducts as tt, toStorefrontBikeProducts as nt, toStorefrontBookingProducts as rt, toStorefrontBookingProductsCollections as it } from "./lib/products.js";
|
|
17
|
+
import { StorefrontCartProvider as at, resolveStorefrontCartItemProduct as ot, useStorefrontCart as st } from "./lib/cart.js";
|
|
18
|
+
import { cn as ct, formatPriceMinor as lt, getAvailabilityVariant as ut, getMinDayPriceMinor as dt } from "./lib/utils.js";
|
|
19
|
+
import { buildDailyPriceRows as ft, buildPriceTierLabels as pt, calculateDailyPriceForQuantity as mt, formatStorefrontPriceMinor as ht } from "./lib/pricing.js";
|
|
20
|
+
import { getLocalizedEntry as gt, getLocalizedValue as _t } from "./localization.js";
|
|
21
|
+
import { buildStorefrontCartSummary as vt } from "./lib/cartSummary.js";
|
|
22
|
+
import { ROUTE as yt, requestSchema as bt, responseSchema as xt } from "./lib/contactForm.js";
|
|
23
|
+
import { formatStorefrontPhoneDisplay as St, resolveStorefrontMapsHref as Ct, resolveStorefrontPhoneContact as wt } from "./lib/storefrontContact.js";
|
|
24
|
+
import { buildWhatsAppHref as Tt, resolveStorefrontWhatsAppContact as Et, resolveStorefrontWhatsAppHref as Dt } from "./lib/whatsapp.js";
|
|
25
|
+
import { ROUTE as Ot, requestBaseSchema as kt, requestCheckoutItemSchema as At, requestDeliveryRefinement as jt, requestSchema as Mt, responseSchema as Nt } from "./lib/checkoutSubmit.js";
|
|
26
|
+
import { ROUTE as Pt, requestSchema as Ft, responseSchema as It, storefrontPublicAccessoryProductSchema as Lt, storefrontPublicBikeAvailabilityStatusSchema as Rt, storefrontPublicBikeProductSchema as zt, storefrontPublicProductDisplayModeSchema as Bt, storefrontPublicProductPriceSchema as Vt, storefrontPublicProductVariantAttributeSchema as Ht, storefrontPublicProductVariantIdentifierSchema as Ut, storefrontPublicProductVariantSchema as Wt } from "./lib/storefrontProducts.js";
|
|
27
|
+
import { ROUTE as Gt, buildStorefrontAvailabilityKey as Kt, doesStorefrontAvailabilityDisplaySoldOut as qt, getStorefrontAvailabilityIssue as Jt, getStorefrontAvailabilityStatus as Yt, isStorefrontAvailabilityInsufficient as Xt, publicAvailabilityDisplayModeSchema as Zt, requestSchema as Qt, responseSchema as $t, shouldBlockStorefrontUnavailableItem as en, storefrontAvailabilityProductSchema as tn, storefrontAvailabilityScheduleSchema as nn, storefrontPublicAvailabilityRecordSchema as rn } from "./lib/storefrontAvailability.js";
|
|
28
|
+
import { ROUTE as an, buildStorefrontImageUrl as on, requestSchema as sn } from "./lib/storefrontImage.js";
|
|
29
|
+
import { ROUTE as cn, requestSchema as ln, responseSchema as un, storefrontTimeSlotSchema as dn, timeSlotJourneySchema as fn } from "./lib/storefrontTimeSlots.js";
|
|
30
|
+
import { Footer as pn } from "./components/Footer/index.js";
|
|
31
|
+
import { Badge as mn, badgeVariants as hn } from "./ui/badge.js";
|
|
32
|
+
import { Button as gn, buttonVariants as _n } from "./ui/button.js";
|
|
33
|
+
import { Header as vn } from "./components/Header/index.js";
|
|
34
|
+
import { storefront as yn } from "./i18n/en.js";
|
|
35
|
+
import { storefront as bn } from "./i18n/fr.js";
|
|
36
|
+
import { PoweredByLoczerBadge as xn } from "./components/PoweredByLoczerBadge/index.js";
|
|
37
|
+
import { PlatformFooter as Sn } from "./components/PlatformFooter/index.js";
|
|
38
|
+
import { useWhatsAppFloatingButton as Cn } from "./components/WhatsAppFloatingButton/useWhatsAppFloatingButton.js";
|
|
39
|
+
import { WhatsAppFloatingButton as wn } from "./components/WhatsAppFloatingButton/WhatsAppFloatingButton.js";
|
|
40
40
|
import "./components/WhatsAppFloatingButton/index.js";
|
|
41
|
-
import { Layout as
|
|
42
|
-
import { DelayedPlaceholder as
|
|
43
|
-
import { BookingPeriodProvider as
|
|
44
|
-
import { Label as
|
|
45
|
-
import { BookingStartDateField as
|
|
46
|
-
import { BookingStartTimeField as
|
|
47
|
-
import { BookingEndDateField as
|
|
48
|
-
import { BookingEndTimeField as
|
|
49
|
-
import { BookingMobileDateDrawer as
|
|
50
|
-
import { BookingPeriodSelector as
|
|
51
|
-
import { BookingFlowSteps as
|
|
52
|
-
import { Input as
|
|
53
|
-
import { DeliveryAddressSelector as
|
|
54
|
-
import { loader as
|
|
55
|
-
import { Form as
|
|
56
|
-
import { Textarea as
|
|
57
|
-
import { ContactSection as
|
|
58
|
-
import { TestimonialsSection as
|
|
59
|
-
import { AboutSection as
|
|
60
|
-
import { StepSectionTitle as
|
|
61
|
-
import { Card as
|
|
62
|
-
import { ProductWarningNotice as
|
|
63
|
-
import { StorefrontCartPanel as
|
|
64
|
-
import { ProductPriceBadge as
|
|
65
|
-
import { ContractSaleDocument as
|
|
41
|
+
import { Layout as Tn } from "./components/Layout/index.js";
|
|
42
|
+
import { DelayedPlaceholder as En, DelayedReveal as Dn } from "./components/DelayedReveal/index.js";
|
|
43
|
+
import { BookingPeriodProvider as On, useBookingPeriod as kn } from "./components/BookingPeriodSelector/BookingPeriodContext.js";
|
|
44
|
+
import { Label as An } from "./ui/label.js";
|
|
45
|
+
import { BookingStartDateField as jn } from "./components/BookingPeriodSelector/components/BookingStartDateField.js";
|
|
46
|
+
import { BookingStartTimeField as Mn } from "./components/BookingPeriodSelector/components/BookingStartTimeField.js";
|
|
47
|
+
import { BookingEndDateField as Nn } from "./components/BookingPeriodSelector/components/BookingEndDateField.js";
|
|
48
|
+
import { BookingEndTimeField as Pn } from "./components/BookingPeriodSelector/components/BookingEndTimeField.js";
|
|
49
|
+
import { BookingMobileDateDrawer as Fn } from "./components/BookingPeriodSelector/components/BookingMobileDateDrawer.js";
|
|
50
|
+
import { BookingPeriodSelector as In } from "./components/BookingPeriodSelector/index.js";
|
|
51
|
+
import { BookingFlowSteps as Ln } from "./components/BookingFlowSteps/index.js";
|
|
52
|
+
import { Input as Rn } from "./ui/input.js";
|
|
53
|
+
import { DeliveryAddressSelector as zn } from "./components/DeliveryAddressSelector/index.js";
|
|
54
|
+
import { loader as Bn, useOptionalStorefront as Vn, useStorefront as Hn, useStorefrontBookingProducts as Un, useStorefrontConfig as Wn, useStorefrontProducts as Gn, useStorefrontWorkspaceLanguage as Kn } from "./StorefrontProvider.js";
|
|
55
|
+
import { Form as qn, FormControl as Jn, FormDescription as Yn, FormField as Xn, FormItem as Zn, FormLabel as Qn, FormMessage as $n, useFormField as er } from "./ui/form.js";
|
|
56
|
+
import { Textarea as tr } from "./ui/textarea.js";
|
|
57
|
+
import { ContactSection as nr } from "./components/ContactSection/index.js";
|
|
58
|
+
import { TestimonialsSection as rr } from "./components/TestimonialsSection/index.js";
|
|
59
|
+
import { AboutSection as ir } from "./components/AboutSection/index.js";
|
|
60
|
+
import { StepSectionTitle as ar } from "./components/StepSectionTitle/index.js";
|
|
61
|
+
import { Card as or, CardAction as sr, CardContent as cr, CardDescription as lr, CardFooter as ur, CardHeader as dr, CardTitle as fr } from "./ui/card.js";
|
|
62
|
+
import { ProductWarningNotice as pr } from "./components/ProductWarningNotice/index.js";
|
|
63
|
+
import { StorefrontCartPanel as mr } from "./components/StorefrontCartPanel/index.js";
|
|
64
|
+
import { ProductPriceBadge as hr } from "./components/ProductPriceBadge/index.js";
|
|
65
|
+
import { ContractSaleDocument as gr } from "./components/ContractSaleDocument/Invoice.js";
|
|
66
66
|
import "./components/ContractSaleDocument/index.js";
|
|
67
|
-
import { RadioGroup as
|
|
67
|
+
import { RadioGroup as _r, RadioGroupItem as vr } from "./ui/radio-group.js";
|
|
68
68
|
import "./pages/HomePage.js";
|
|
69
69
|
import "./pages/BookingPage.js";
|
|
70
70
|
import "./pages/ProductPage.js";
|
|
71
71
|
import "./pages/CheckoutPage.js";
|
|
72
72
|
import "./pages/CheckoutSuccessPage.js";
|
|
73
73
|
import "./pages/NotFoundPage.js";
|
|
74
|
-
import { accessories as
|
|
75
|
-
import
|
|
76
|
-
import { contractSaleDocumentAcceptanceLevelSchema as
|
|
77
|
-
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as
|
|
78
|
-
import
|
|
79
|
-
import { Select as
|
|
80
|
-
export {
|
|
74
|
+
import { accessories as yr } from "./data/accessories.js";
|
|
75
|
+
import br from "./data/bikes.js";
|
|
76
|
+
import { contractSaleDocumentAcceptanceLevelSchema as xr, contractSaleDocumentAcceptanceRecordSchema as Sr, contractSaleDocumentAcceptanceSchema as Cr, contractSaleDocumentAddressSchema as wr, contractSaleDocumentContactSchema as Tr, contractSaleDocumentKindSchema as Er, contractSaleDocumentLanguageCodeSchema as Dr, contractSaleDocumentLanguageSchema as Or, contractSaleDocumentLineItemSchema as kr, contractSaleDocumentSchema as Ar, contractSaleDocumentSignatureSchema as jr } from "./lib/contractSaleDocument.js";
|
|
77
|
+
import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as Mr, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as Nr, GET_CONTRACT_SALE_DOCUMENT_ROUTE as Pr, acceptContractSaleDocumentRequestSchema as Fr, acceptContractSaleDocumentResponseSchema as Ir, contractSaleDocumentAcceptanceInputSchema as Lr, contractSaleDocumentAcceptanceRecordInputSchema as Rr, contractSaleDocumentApiAcceptanceRecordSchema as zr, contractSaleDocumentApiAcceptanceSchema as Br, contractSaleDocumentApiSchema as Vr, contractSaleDocumentApiSignatureSchema as Hr, contractSaleDocumentReferenceSchema as Ur, contractSaleDocumentReferenceTypeSchema as Wr, contractSaleDocumentSignatureInputSchema as Gr, downloadContractSaleDocumentPdfRequestSchema as Kr, getContractSaleDocumentRequestSchema as qr, getContractSaleDocumentResponseSchema as Jr } from "./lib/contractSaleDocumentApi.js";
|
|
78
|
+
import Yr from "./routes.js";
|
|
79
|
+
import { Select as Xr, SelectContent as Zr, SelectGroup as Qr, SelectIcon as $r, SelectItem as ei, SelectItemIndicator as ti, SelectItemText as ni, SelectLabel as ri, SelectScrollDownButton as ii, SelectScrollUpButton as ai, SelectSeparator as oi, SelectTrigger as si, SelectValue as ci } from "./ui/select.js";
|
|
80
|
+
export { Mr as ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE, ir as AboutSection, Se as BOOKING_SEARCH_KEYS, mn as Badge, Nn as BookingEndDateField, Pn as BookingEndTimeField, Ln as BookingFlowSteps, Fn as BookingMobileDateDrawer, On as BookingPeriodProvider, In as BookingPeriodSelector, jn as BookingStartDateField, Mn as BookingStartTimeField, gn as Button, Ve as CATALOG_PRODUCT_BASE_RATE_UNSET, or as Card, sr as CardAction, cr as CardContent, lr as CardDescription, ur as CardFooter, dr as CardHeader, fr as CardTitle, nr as ContactSection, gr as ContractSaleDocument, q as DEFAULT_BOOKING_DELIVERY_OPTION, R as DEFAULT_CANCELLATION_POLICY, z as DEFAULT_PAYMENT_POLICIES, Nr as DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE, En as DelayedPlaceholder, Dn as DelayedReveal, zn as DeliveryAddressSelector, pn as Footer, qn as Form, Jn as FormControl, Yn as FormDescription, Xn as FormField, Zn as FormItem, Qn as FormLabel, $n as FormMessage, Pr as GET_CONTRACT_SALE_DOCUMENT_ROUTE, vn as Header, Rn as Input, An as Label, Tn as Layout, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, Sn as PlatformFooter, xn as PoweredByLoczerBadge, hr as ProductPriceBadge, pr as ProductWarningNotice, yt as ROUTE, _r as RadioGroup, vr as RadioGroupItem, Gt as STOREFRONT_AVAILABILITY_ROUTE, Ot as STOREFRONT_CHECKOUT_SUBMIT_ROUTE, an as STOREFRONT_IMAGE_ROUTE, Pt as STOREFRONT_PRODUCTS_ROUTE, cn as STOREFRONT_TIME_SLOTS_ROUTE, Xr as Select, Zr as SelectContent, Qr as SelectGroup, $r as SelectIcon, ei as SelectItem, ti as SelectItemIndicator, ni as SelectItemText, ri as SelectLabel, ii as SelectScrollDownButton, ai as SelectScrollUpButton, oi as SelectSeparator, si as SelectTrigger, ci as SelectValue, ar as StepSectionTitle, mr as StorefrontCartPanel, at as StorefrontCartProvider, Ce as TIME_OPTIONS, rr as TestimonialsSection, tr as Textarea, wn as WhatsAppFloatingButton, Fr as acceptContractSaleDocumentRequestSchema, Ir as acceptContractSaleDocumentResponseSchema, yr as accessories, h as accessoryProductSchema, we as applyBookingParamsToSearch, hn as badgeVariants, ne as baseAssetSchema, re as baseAssetStatusSchema, ie as baseBookingItemSchema, ae as baseBookingSchema, oe as baseBookingStateSchema, g as bikeProductSchema, br as bikes, J as bookingCustomerInputSchema, Y as bookingDeliveryOptionSchema, X as bookingScheduleInputSchema, ft as buildDailyPriceRows, pt as buildPriceTierLabels, Kt as buildStorefrontAvailabilityKey, vt as buildStorefrontCartSummary, on as buildStorefrontImageUrl, He as buildStorefrontProductSlug, Ue as buildVariantStorefrontProductId, Tt as buildWhatsAppHref, _n as buttonVariants, mt as calculateDailyPriceForQuantity, B as cancellationPolicySchema, V as cancellationPolicyTierSchema, Z as cartItemInputSchema, ct as cn, We as compareCatalogProducts, Ge as compareStorefrontAccessoryProducts, Ke as compareStorefrontBikeProducts, Lr as contractSaleDocumentAcceptanceInputSchema, xr as contractSaleDocumentAcceptanceLevelSchema, Rr as contractSaleDocumentAcceptanceRecordInputSchema, Sr as contractSaleDocumentAcceptanceRecordSchema, Cr as contractSaleDocumentAcceptanceSchema, wr as contractSaleDocumentAddressSchema, zr as contractSaleDocumentApiAcceptanceRecordSchema, Br as contractSaleDocumentApiAcceptanceSchema, Vr as contractSaleDocumentApiSchema, Hr as contractSaleDocumentApiSignatureSchema, Tr as contractSaleDocumentContactSchema, Er as contractSaleDocumentKindSchema, Dr as contractSaleDocumentLanguageCodeSchema, Or as contractSaleDocumentLanguageSchema, kr as contractSaleDocumentLineItemSchema, Ur as contractSaleDocumentReferenceSchema, Wr as contractSaleDocumentReferenceTypeSchema, Ar as contractSaleDocumentSchema, Gr as contractSaleDocumentSignatureInputSchema, jr as contractSaleDocumentSignatureSchema, Q as createBookingInputBaseSchema, $ as createBookingInputSchema, Te as createBookingPeriodConfigFromBookingEngineConfiguration, Ee as createBookingPeriodConfigFromShopConfiguration, De as createBookingPeriodConfigFromStorefrontConfiguration, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, qt as doesStorefrontAvailabilityDisplaySoldOut, Kr as downloadContractSaleDocumentPdfRequestSchema, _ as eBikeProductSchema, qe as findStorefrontProduct, Je as findStorefrontProductBySlug, lt as formatPriceMinor, St as formatStorefrontPhoneDisplay, ht as formatStorefrontPriceMinor, U as fulfillmentModeSchema, ut as getAvailabilityVariant, Oe as getBookingDurationLabel, ke as getBookingDurationMinutes, Ae as getBookingParamsFromSearch, je as getBookingSessionStorageKey, Ye as getCatalogProductBaseRateMinor, Xe as getCatalogProductPaginationSort, Ze as getCatalogProductSortFieldForPriceUnit, qr as getContractSaleDocumentRequestSchema, Jr as getContractSaleDocumentResponseSchema, Me as getDefaultBookingParams, Ne as getDefaultBookingParamsForStorefrontConfiguration, gt as getLocalizedEntry, t as getLocalizedStringValue, _t as getLocalizedValue, dt as getMinDayPriceMinor, Jt as getStorefrontAvailabilityIssue, Yt as getStorefrontAvailabilityStatus, Qe as getStorefrontBaseDailyRateMinor, $e as getStorefrontCheckoutProductId, et as getStorefrontRepresentedVariantId, v as isProductVariantCodeIdentifierKind, Xt as isStorefrontAvailabilityInsufficient, k as isoDateSchema, Bn as loader, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, H as paymentPoliciesSchema, Pe as pickBookingSearchParams, d as priceSchema, f as priceUnitSchema, y as productKindSchema, b as productSchema, x as productStorefrontDisplayModeSchema, S as productVariantAttributeSchema, C as productVariantCodeSchema, w as productVariantIdentifierSchema, T as productVariantSchema, Zt as publicAvailabilityDisplayModeSchema, W as publicBookingEngineConfigurationSchema, G as publicCheckoutConfigurationSchema, K as publicCheckoutDynamicOptionsSchema, Fe as readBookingSearchParamsFromSessionStorage, Ie as readBookingSearchParamsFromStorage, bt as requestSchema, ee as resolveBookingDeliveryOption, Le as resolveBookingSearchParams, Re as resolveBookingSearchParamsFromSessionStorage, ot as resolveStorefrontCartItemProduct, Ct as resolveStorefrontMapsHref, wt as resolveStorefrontPhoneContact, Et as resolveStorefrontWhatsAppContact, Dt as resolveStorefrontWhatsAppHref, xt as responseSchema, E as richTextJsonDocSchema, D as richTextSchema, O as richTextVersionSchema, A as shopConfigurationSchema, j as shopExtraTimeSlotRuleSchema, M as shopOpeningDayIndexSchema, N as shopOpeningDaySchema, P as shopOpeningHoursOverrideSchema, F as shopOpeningHoursPeriodSchema, I as shopOpeningSlotSchema, en as shouldBlockStorefrontUnavailableItem, u as signedMoneyMinorSchema, tn as storefrontAvailabilityProductSchema, Qt as storefrontAvailabilityRequestSchema, $t as storefrontAvailabilityResponseSchema, nn as storefrontAvailabilityScheduleSchema, se as storefrontCheckoutModeSchema, jt as storefrontCheckoutSubmitDeliveryRefinement, At as storefrontCheckoutSubmitItemSchema, kt as storefrontCheckoutSubmitRequestBaseSchema, Mt as storefrontCheckoutSubmitRequestSchema, Nt as storefrontCheckoutSubmitResponseSchema, ce as storefrontConfigurationSchema, le as storefrontContentSchema, yn as storefrontEn, ue as storefrontFaqItemSchema, de as storefrontFaqSchema, bn as storefrontFr, fe as storefrontFulfillmentModeSchema, sn as storefrontImageRequestSchema, pe as storefrontLocalizedRichTextSchema, me as storefrontModalMessageSchema, he as storefrontModulesSchema, Ft as storefrontProductsRequestSchema, It as storefrontProductsResponseSchema, Lt as storefrontPublicAccessoryProductSchema, rn as storefrontPublicAvailabilityRecordSchema, Rt as storefrontPublicBikeAvailabilityStatusSchema, zt as storefrontPublicBikeProductSchema, Bt as storefrontPublicProductDisplayModeSchema, Vt as storefrontPublicProductPriceSchema, Ht as storefrontPublicProductVariantAttributeSchema, Ut as storefrontPublicProductVariantIdentifierSchema, Wt as storefrontPublicProductVariantSchema, ge as storefrontReviewsModuleSchema, _e as storefrontRichTextSchema, Yr as storefrontRoutes, ve as storefrontSettingsSchema, ye as storefrontShopSchema, be as storefrontStatusSchema, fn as storefrontTimeSlotJourneySchema, dn as storefrontTimeSlotSchema, ln as storefrontTimeSlotsRequestSchema, un as storefrontTimeSlotsResponseSchema, xe as storefrontWorkspaceSchema, L as timeOfDaySchema, tt as toStorefrontAccessoryProducts, nt as toStorefrontBikeProducts, rt as toStorefrontBookingProducts, it as toStorefrontBookingProductsCollections, kn as useBookingPeriod, er as useFormField, Vn as useOptionalStorefront, Hn as useStorefront, Un as useStorefrontBookingProducts, st as useStorefrontCart, Wn as useStorefrontConfig, Gn as useStorefrontProducts, Kn as useStorefrontWorkspaceLanguage, Cn as useWhatsAppFloatingButton, te as validateBookingDeliveryAddress, ze as writeBookingSearchParamsToSessionStorage, Be as writeBookingSearchParamsToStorage };
|
package/dist/lib/booking.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export type StorefrontBookingParams = {
|
|
|
14
14
|
type BookingSearchStorage = Pick<Storage, "getItem" | "removeItem" | "setItem"> | null | undefined;
|
|
15
15
|
export declare const TIME_OPTIONS: string[];
|
|
16
16
|
export declare const getDefaultBookingParams: (now?: Date) => StorefrontBookingParams;
|
|
17
|
+
export declare const createBookingPeriodConfigFromShopConfiguration: (shop: StorefrontConfiguration["bookingEngine"]["shop"], options?: {
|
|
18
|
+
sameDayCutoff?: string;
|
|
19
|
+
}) => BookingPeriodConfig;
|
|
17
20
|
export declare const createBookingPeriodConfigFromBookingEngineConfiguration: (bookingEngine: StorefrontConfiguration["bookingEngine"], options?: {
|
|
18
21
|
sameDayCutoff?: string;
|
|
19
22
|
}) => BookingPeriodConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/lib/booking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../src/lib/booking.ts"],"names":[],"mappings":"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"}
|
package/dist/lib/booking.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { DEFAULT_BOOKING_DELIVERY_OPTION as e } from "../chunks/booking-engine/dist/schemas/cart-inputs-j1yWfJxO.js";
|
|
2
|
+
import "../chunks/booking-engine/dist/schemas-DftrSnTE.js";
|
|
3
|
+
import { getDefaultBookingPeriod as t, parseTimeToMinutes as n } from "./booking-period.js";
|
|
4
|
+
import { differenceInMinutes as r, format as i } from "date-fns";
|
|
3
5
|
//#region src/lib/booking.ts
|
|
4
|
-
var
|
|
6
|
+
var a = [
|
|
5
7
|
"fulfillment",
|
|
6
8
|
"start_date",
|
|
7
9
|
"start_time",
|
|
@@ -9,78 +11,78 @@ var i = [
|
|
|
9
11
|
"end_time",
|
|
10
12
|
"start_address",
|
|
11
13
|
"end_address"
|
|
12
|
-
],
|
|
14
|
+
], o = "loczer_storefront_booking:", s = (e) => i(e, "yyyy-MM-dd"), c = (() => {
|
|
13
15
|
let e = [];
|
|
14
16
|
for (let t = 8; t <= 18; t += 1) for (let n of [0, 30]) t === 18 && n > 0 || e.push(`${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`);
|
|
15
17
|
return e;
|
|
16
|
-
})(),
|
|
17
|
-
let
|
|
18
|
+
})(), l = (t = /* @__PURE__ */ new Date()) => {
|
|
19
|
+
let n = s(t);
|
|
18
20
|
return {
|
|
19
|
-
fulfillment:
|
|
20
|
-
start_date:
|
|
21
|
-
start_time:
|
|
22
|
-
end_date:
|
|
23
|
-
end_time:
|
|
21
|
+
fulfillment: e,
|
|
22
|
+
start_date: n,
|
|
23
|
+
start_time: c[3] ?? "09:30",
|
|
24
|
+
end_date: n,
|
|
25
|
+
end_time: c.at(-1) ?? "18:00",
|
|
24
26
|
start_address: "",
|
|
25
27
|
end_address: ""
|
|
26
28
|
};
|
|
27
|
-
},
|
|
29
|
+
}, u = 30, d = 15, f = 10, p = 960, m = (e) => n(e) ?? p, h = (e) => (Math.trunc(e) % 7 + 7) % 7, g = (e) => {
|
|
28
30
|
if (e?.length) return e.map((e) => ({
|
|
29
31
|
minutesAfterClose: e.minutesAfterClose,
|
|
30
32
|
extraAmount: e.extraAmount
|
|
31
33
|
}));
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
openingHours: e.
|
|
34
|
+
}, _ = (e, t = {}) => ({
|
|
35
|
+
timing: {
|
|
36
|
+
slotIntervalMinutes: u,
|
|
37
|
+
autoFillCutoffMinutes: m(t.sameDayCutoff),
|
|
38
|
+
pastToleranceMinutes: d,
|
|
39
|
+
minBufferMinutes: f
|
|
40
|
+
},
|
|
41
|
+
openingHours: e.openingHours.map((e) => ({
|
|
42
|
+
...e,
|
|
43
|
+
openingHours: e.openingHours.map((e) => ({
|
|
42
44
|
...e,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
},
|
|
53
|
-
let
|
|
54
|
-
config:
|
|
55
|
-
referenceDate:
|
|
45
|
+
day: h(e.day)
|
|
46
|
+
}))
|
|
47
|
+
})),
|
|
48
|
+
openingHoursOverrides: e.openingHoursOverrides ?? [],
|
|
49
|
+
timeZone: e.timeZone,
|
|
50
|
+
extraTimeSlots: g(e.extraTimeSlots)
|
|
51
|
+
}), v = (e, t = {}) => {
|
|
52
|
+
let n = e.checkout.dynamicOptions?.sameDayCutoff;
|
|
53
|
+
return _(e.shop, { sameDayCutoff: t.sameDayCutoff ?? n });
|
|
54
|
+
}, y = (e) => v(e.bookingEngine, { sameDayCutoff: e.settings.sameDayCutoff }), b = (n, r = /* @__PURE__ */ new Date()) => {
|
|
55
|
+
let i = t({
|
|
56
|
+
config: y(n),
|
|
57
|
+
referenceDate: r
|
|
56
58
|
});
|
|
57
59
|
return {
|
|
58
|
-
fulfillment:
|
|
59
|
-
start_date:
|
|
60
|
-
start_time:
|
|
61
|
-
end_date:
|
|
62
|
-
end_time:
|
|
60
|
+
fulfillment: e,
|
|
61
|
+
start_date: s(i.startDate),
|
|
62
|
+
start_time: i.startTime,
|
|
63
|
+
end_date: s(i.endDate),
|
|
64
|
+
end_time: i.endTime,
|
|
63
65
|
start_address: "",
|
|
64
66
|
end_address: ""
|
|
65
67
|
};
|
|
66
|
-
},
|
|
68
|
+
}, x = (e, t, n) => {
|
|
67
69
|
let r = e.get(t);
|
|
68
70
|
return r == null || r.trim() === "" ? n : r;
|
|
69
|
-
},
|
|
71
|
+
}, S = (e, t) => {
|
|
70
72
|
let n = {
|
|
71
|
-
...
|
|
73
|
+
...l(),
|
|
72
74
|
...t
|
|
73
75
|
};
|
|
74
76
|
return {
|
|
75
77
|
fulfillment: e.get("fulfillment") === "delivery" ? "delivery" : e.get("fulfillment") === "pickup" ? "pickup" : n.fulfillment,
|
|
76
|
-
start_date:
|
|
77
|
-
start_time:
|
|
78
|
-
end_date:
|
|
79
|
-
end_time:
|
|
80
|
-
start_address:
|
|
81
|
-
end_address:
|
|
78
|
+
start_date: x(e, "start_date", n.start_date),
|
|
79
|
+
start_time: x(e, "start_time", n.start_time),
|
|
80
|
+
end_date: x(e, "end_date", n.end_date),
|
|
81
|
+
end_time: x(e, "end_time", n.end_time),
|
|
82
|
+
start_address: x(e, "start_address", n.start_address),
|
|
83
|
+
end_address: x(e, "end_address", n.end_address)
|
|
82
84
|
};
|
|
83
|
-
},
|
|
85
|
+
}, C = (e, t) => {
|
|
84
86
|
let n = new URLSearchParams(e), r = (e, t) => {
|
|
85
87
|
if (t != null) {
|
|
86
88
|
if (t.trim() === "") {
|
|
@@ -91,38 +93,38 @@ var i = [
|
|
|
91
93
|
}
|
|
92
94
|
};
|
|
93
95
|
return r("fulfillment", t.fulfillment), r("start_date", t.start_date), r("start_time", t.start_time), r("end_date", t.end_date), r("end_time", t.end_time), r("start_address", t.start_address), r("end_address", t.end_address), n;
|
|
94
|
-
},
|
|
96
|
+
}, w = (e) => {
|
|
95
97
|
let t = new URLSearchParams();
|
|
96
|
-
for (let n of
|
|
98
|
+
for (let n of a) {
|
|
97
99
|
let r = e.get(n);
|
|
98
100
|
if (r == null) continue;
|
|
99
101
|
let i = r.trim();
|
|
100
102
|
i.length !== 0 && t.set(n, i);
|
|
101
103
|
}
|
|
102
104
|
return t;
|
|
103
|
-
},
|
|
105
|
+
}, T = () => {
|
|
104
106
|
if (typeof window > "u") return null;
|
|
105
107
|
try {
|
|
106
108
|
return window.sessionStorage;
|
|
107
109
|
} catch {
|
|
108
110
|
return null;
|
|
109
111
|
}
|
|
110
|
-
},
|
|
112
|
+
}, E = (e) => e instanceof URLSearchParams ? w(e) : C(new URLSearchParams(), e), D = (e) => {
|
|
111
113
|
let t = e?.trim() ?? "";
|
|
112
|
-
return t ? `${
|
|
113
|
-
},
|
|
114
|
-
let n =
|
|
114
|
+
return t ? `${o}${t}` : "";
|
|
115
|
+
}, O = (e, t) => {
|
|
116
|
+
let n = D(t);
|
|
115
117
|
if (!n || !e) return new URLSearchParams();
|
|
116
118
|
try {
|
|
117
119
|
let t = e.getItem(n);
|
|
118
|
-
return t ?
|
|
120
|
+
return t ? w(new URLSearchParams(t)) : new URLSearchParams();
|
|
119
121
|
} catch {
|
|
120
122
|
return new URLSearchParams();
|
|
121
123
|
}
|
|
122
|
-
},
|
|
123
|
-
let r =
|
|
124
|
+
}, k = (e, t, n) => {
|
|
125
|
+
let r = D(t);
|
|
124
126
|
if (!r || !e) return;
|
|
125
|
-
let i =
|
|
127
|
+
let i = E(n).toString();
|
|
126
128
|
try {
|
|
127
129
|
if (!i) {
|
|
128
130
|
e.removeItem(r);
|
|
@@ -130,19 +132,19 @@ var i = [
|
|
|
130
132
|
}
|
|
131
133
|
e.setItem(r, i);
|
|
132
134
|
} catch {}
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
let n =
|
|
137
|
-
return n.toString() ? n :
|
|
138
|
-
},
|
|
139
|
-
storage:
|
|
135
|
+
}, A = (e) => O(T(), e), j = (e, t) => {
|
|
136
|
+
k(T(), e, t);
|
|
137
|
+
}, M = (e, t) => {
|
|
138
|
+
let n = w(e);
|
|
139
|
+
return n.toString() ? n : O(t?.storage, t?.storeSlug);
|
|
140
|
+
}, N = (e, t) => M(e, {
|
|
141
|
+
storage: T(),
|
|
140
142
|
storeSlug: t
|
|
141
|
-
}),
|
|
142
|
-
let t = /* @__PURE__ */ new Date(`${e.start_date}T${e.start_time}:00`),
|
|
143
|
-
return Number.isNaN(t.getTime()) || Number.isNaN(
|
|
144
|
-
},
|
|
145
|
-
let t =
|
|
143
|
+
}), P = (e) => {
|
|
144
|
+
let t = /* @__PURE__ */ new Date(`${e.start_date}T${e.start_time}:00`), n = /* @__PURE__ */ new Date(`${e.end_date}T${e.end_time}:00`);
|
|
145
|
+
return Number.isNaN(t.getTime()) || Number.isNaN(n.getTime()) ? 0 : Math.max(0, r(n, t));
|
|
146
|
+
}, F = (e) => {
|
|
147
|
+
let t = P(e), n = Math.floor(t / 60), r = t % 60;
|
|
146
148
|
return r === 0 ? {
|
|
147
149
|
hours: n,
|
|
148
150
|
minutes: r,
|
|
@@ -154,4 +156,4 @@ var i = [
|
|
|
154
156
|
};
|
|
155
157
|
};
|
|
156
158
|
//#endregion
|
|
157
|
-
export {
|
|
159
|
+
export { a as BOOKING_SEARCH_KEYS, c as TIME_OPTIONS, C as applyBookingParamsToSearch, v as createBookingPeriodConfigFromBookingEngineConfiguration, _ as createBookingPeriodConfigFromShopConfiguration, y as createBookingPeriodConfigFromStorefrontConfiguration, F as getBookingDurationLabel, P as getBookingDurationMinutes, S as getBookingParamsFromSearch, D as getBookingSessionStorageKey, l as getDefaultBookingParams, b as getDefaultBookingParamsForStorefrontConfiguration, w as pickBookingSearchParams, A as readBookingSearchParamsFromSessionStorage, O as readBookingSearchParamsFromStorage, M as resolveBookingSearchParams, N as resolveBookingSearchParamsFromSessionStorage, j as writeBookingSearchParamsToSessionStorage, k as writeBookingSearchParamsToStorage };
|
package/dist/lib/cart.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { StorefrontProduct, StorefrontProductsCollections } from './products';
|
|
2
3
|
export type StorefrontCartItem = {
|
|
3
4
|
key: string;
|
|
4
5
|
kind: "bike" | "e-bike" | "accessory";
|
|
@@ -16,8 +17,10 @@ type StorefrontCartContextValue = {
|
|
|
16
17
|
removeItem: (key: string) => void;
|
|
17
18
|
clear: () => void;
|
|
18
19
|
};
|
|
19
|
-
export declare
|
|
20
|
+
export declare const resolveStorefrontCartItemProduct: (item: StorefrontCartItem, products: StorefrontProductsCollections) => StorefrontProduct | null;
|
|
21
|
+
export declare function StorefrontCartProvider({ storeSlug, products, children, }: {
|
|
20
22
|
storeSlug: string;
|
|
23
|
+
products: StorefrontProductsCollections;
|
|
21
24
|
children: ReactNode;
|
|
22
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
26
|
export declare const useStorefrontCart: () => StorefrontCartContextValue;
|
package/dist/lib/cart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../src/lib/cart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../src/lib/cart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5G,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EACnC,MAAM,YAAY,CAAA;AAGnB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAA;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAMD,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC3E,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAWD,eAAO,MAAM,gCAAgC,GAC3C,MAAM,kBAAkB,EACxB,UAAU,6BAA6B,KACtC,iBAAiB,GAAG,IAQtB,CAAA;AA+CD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,6BAA6B,CAAA;IACvC,QAAQ,EAAE,SAAS,CAAA;CACpB,2CAuGA;AAED,eAAO,MAAM,iBAAiB,kCAM7B,CAAA"}
|