@fleetbridge/ui 1.4.0 → 1.4.1
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/index.d.ts +2 -0
- package/index.js +902 -891
- package/package.json +1 -1
- package/server.js +9 -3
- package/styles.css +1 -1
package/index.js
CHANGED
|
@@ -779,6 +779,69 @@ function withPackage(car, pkg, tier = "standard") {
|
|
|
779
779
|
quoteRef: pkg.quoteRef || car.quoteRef
|
|
780
780
|
};
|
|
781
781
|
}
|
|
782
|
+
var kmKey = (p) => p.unlimitedMileage ? "u" : String(p.kmPerDay || 0);
|
|
783
|
+
var kmValue = (key) => key === "u" ? 1e5 : Number(key) || 0;
|
|
784
|
+
function commonKm(cars) {
|
|
785
|
+
const counts = /* @__PURE__ */ new Map();
|
|
786
|
+
for (const car of cars) {
|
|
787
|
+
const keys = new Set((car.packages ?? []).filter((p) => p.kmSelectable !== false).map(kmKey));
|
|
788
|
+
keys.forEach((k) => counts.set(k, (counts.get(k) ?? 0) + 1));
|
|
789
|
+
}
|
|
790
|
+
let best = null;
|
|
791
|
+
counts.forEach((n, k) => {
|
|
792
|
+
if (best === null || n > counts.get(best) || n === counts.get(best) && kmValue(k) > kmValue(best)) best = k;
|
|
793
|
+
});
|
|
794
|
+
return best;
|
|
795
|
+
}
|
|
796
|
+
function packageIndexForKm(car, key) {
|
|
797
|
+
if (key === null) return 0;
|
|
798
|
+
const target = kmValue(key);
|
|
799
|
+
let best = -1;
|
|
800
|
+
car.packages.forEach((p, i) => {
|
|
801
|
+
if (p.kmSelectable === false) return;
|
|
802
|
+
if (best < 0) {
|
|
803
|
+
best = i;
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
const a = car.packages[best];
|
|
807
|
+
const dp = Math.abs(kmValue(kmKey(p)) - target);
|
|
808
|
+
const da = Math.abs(kmValue(kmKey(a)) - target);
|
|
809
|
+
const cheaper = p.totalRate > 0 && (a.totalRate <= 0 || p.totalRate < a.totalRate);
|
|
810
|
+
if (dp < da || dp === da && (kmValue(kmKey(p)) > kmValue(kmKey(a)) || kmKey(p) === kmKey(a) && cheaper)) best = i;
|
|
811
|
+
});
|
|
812
|
+
return best < 0 ? 0 : best;
|
|
813
|
+
}
|
|
814
|
+
function withComparedKm(cars, opts = {}) {
|
|
815
|
+
const { minKm } = opts;
|
|
816
|
+
const key = opts.key !== void 0 ? opts.key : commonKm(cars);
|
|
817
|
+
return cars.map((car) => {
|
|
818
|
+
if (!car.packages?.length) return car;
|
|
819
|
+
let index;
|
|
820
|
+
if (minKm != null) {
|
|
821
|
+
index = -1;
|
|
822
|
+
car.packages.forEach((p, i) => {
|
|
823
|
+
if (p.kmSelectable === false) return;
|
|
824
|
+
const ok = p.unlimitedMileage || minKm !== "unlimited" && p.kmPerDay >= minKm;
|
|
825
|
+
if (!ok) return;
|
|
826
|
+
const a = index >= 0 ? car.packages[index] : null;
|
|
827
|
+
if (!a || p.totalRate > 0 && (a.totalRate <= 0 || p.totalRate < a.totalRate)) index = i;
|
|
828
|
+
});
|
|
829
|
+
if (index < 0) return car;
|
|
830
|
+
} else {
|
|
831
|
+
index = packageIndexForKm(car, key);
|
|
832
|
+
}
|
|
833
|
+
const pkg = car.packages[index];
|
|
834
|
+
return pkg ? withPackage(car, pkg, "standard") : car;
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
function selectedPackageIndex(car, packages = car.packages ?? []) {
|
|
838
|
+
const i = packages.findIndex(
|
|
839
|
+
(p) => kmKey(p) === kmKey(car) && (p.rateNo || car.rateNo) === car.rateNo && (p.totalRate === car.totalRate || p.superCover?.totalRate === car.totalRate)
|
|
840
|
+
);
|
|
841
|
+
if (i >= 0) return i;
|
|
842
|
+
const sameKm = packages.findIndex((p) => kmKey(p) === kmKey(car));
|
|
843
|
+
return sameKm >= 0 ? sameKm : 0;
|
|
844
|
+
}
|
|
782
845
|
|
|
783
846
|
// ../client/src/lib/queries/base.queries.ts
|
|
784
847
|
var BaseQuery = class {
|
|
@@ -906,11 +969,13 @@ function luggageOptionsFromCars(cars) {
|
|
|
906
969
|
return values.length ? values : [2, 3, 4, 5, 6];
|
|
907
970
|
}
|
|
908
971
|
function mileageOptionsFromCars(cars) {
|
|
972
|
+
const packagesOf = (c) => c.packages?.length ? c.packages : [c];
|
|
973
|
+
const all = cars.flatMap(packagesOf);
|
|
909
974
|
const allowances = Array.from(
|
|
910
|
-
new Set(
|
|
975
|
+
new Set(all.filter((p) => !p.unlimitedMileage && p.kmPerDay > 0).map((p) => p.kmPerDay))
|
|
911
976
|
).sort((a, b) => a - b);
|
|
912
977
|
const options = [...allowances];
|
|
913
|
-
if (
|
|
978
|
+
if (all.some((p) => p.unlimitedMileage)) options.push("unlimited");
|
|
914
979
|
return options;
|
|
915
980
|
}
|
|
916
981
|
function meetsMileage(car, mileage) {
|
|
@@ -1730,7 +1795,7 @@ var COUNTRY_GROUPS = [
|
|
|
1730
1795
|
|
|
1731
1796
|
// ../client/src/lib/queries/booking.queries.ts
|
|
1732
1797
|
function bookingRequestFields(request, options = {}) {
|
|
1733
|
-
const { car, criteria, driver, selection, extras, days, dropOffFee, deposit } = request;
|
|
1798
|
+
const { car, criteria, driver, selection, extras, days, dropOffFee, deposit, excess } = request;
|
|
1734
1799
|
const chosen = selectedExtras(selection, extras);
|
|
1735
1800
|
const pickup = criteria.pickupLocation;
|
|
1736
1801
|
const dropoffName = criteria.dropoffLocation === SAME_AS_PICKUP ? pickup : criteria.dropoffLocation;
|
|
@@ -1761,6 +1826,7 @@ function bookingRequestFields(request, options = {}) {
|
|
|
1761
1826
|
// `quoteFor`'s refundable card hold - same BookingRate-only treatment
|
|
1762
1827
|
// as dropOffFee above.
|
|
1763
1828
|
deposit: deposit != null && deposit > 0 ? String(deposit) : "",
|
|
1829
|
+
excess: excess != null && excess > 0 ? String(excess) : "",
|
|
1764
1830
|
// The vehicle rental line only (quoteFor's own 'vehicle' line, i.e.
|
|
1765
1831
|
// car.totalRate) - BookingRate.amount, kept apart from dailyRate below
|
|
1766
1832
|
// (a per-day figure) so both survive on the priced record.
|
|
@@ -5812,7 +5878,7 @@ function SearchWidget({ resultsPageUrl: resultsPageUrlProp, searchStyle, title,
|
|
|
5812
5878
|
import { useCallback as useCallback3, useEffect as useEffect19, useId as useId4, useMemo as useMemo14, useState as useState20 } from "react";
|
|
5813
5879
|
import { createPortal as createPortal3 } from "react-dom";
|
|
5814
5880
|
import { useQueries, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
5815
|
-
import { ArrowUpDown, CalendarDays as CalendarDays5, ChevronDown as
|
|
5881
|
+
import { ArrowUpDown, CalendarDays as CalendarDays5, ChevronDown as ChevronDown4, CircleAlert as CircleAlert4, Info as Info5, RotateCw, SlidersHorizontal as SlidersHorizontal2, X as X5 } from "lucide-react";
|
|
5816
5882
|
|
|
5817
5883
|
// src/components/BookingWizard/index.tsx
|
|
5818
5884
|
import { useEffect as useEffect14, useMemo as useMemo9, useRef as useRef7, useState as useState17 } from "react";
|
|
@@ -6883,7 +6949,7 @@ function CompactVehicleCard({
|
|
|
6883
6949
|
const hasLogo = Boolean(logoUrl) && !logoFailed;
|
|
6884
6950
|
return /* @__PURE__ */ jsx97("section", { className, children: /* @__PURE__ */ jsxs55("div", { className: "overflow-hidden rounded-xl border border-border bg-card", children: [
|
|
6885
6951
|
/* @__PURE__ */ jsxs55("div", { className: "flex items-center gap-4 p-3.5 sm:p-4", children: [
|
|
6886
|
-
/* @__PURE__ */ jsx97("div", { className: "relative
|
|
6952
|
+
/* @__PURE__ */ jsx97("div", { className: "relative h-[4.5rem] w-28 shrink-0 overflow-hidden rounded-lg bg-car-photo sm:h-20 sm:w-32", children: image ? /* @__PURE__ */ jsx97("img", { src: image, alt: "", className: "fb-photo absolute inset-0 size-full object-contain p-2.5" }) : /* @__PURE__ */ jsx97(CarIcon, { className: "absolute top-1/2 left-1/2 size-10 -translate-x-1/2 -translate-y-1/2 text-muted-foreground opacity-30", strokeWidth: 1, "aria-hidden": "true" }) }),
|
|
6887
6953
|
/* @__PURE__ */ jsxs55("div", { className: "min-w-0 flex-1", children: [
|
|
6888
6954
|
/* @__PURE__ */ jsxs55("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6889
6955
|
/* @__PURE__ */ jsxs55("div", { className: "min-w-0", children: [
|
|
@@ -6944,7 +7010,7 @@ function VehicleCard({
|
|
|
6944
7010
|
const specs = /* @__PURE__ */ jsx97("ul", { className: "mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[0.75rem] text-muted-foreground", children: specItems.map((spec) => /* @__PURE__ */ jsx97(MiniSpec, { icon: spec.icon, children: spec.label }, spec.label)) });
|
|
6945
7011
|
return /* @__PURE__ */ jsx97("section", { className, children: /* @__PURE__ */ jsxs55("div", { className: "overflow-hidden rounded-xl border border-border bg-card", children: [
|
|
6946
7012
|
/* @__PURE__ */ jsxs55("div", { className: "relative h-40 bg-car-photo sm:h-44", children: [
|
|
6947
|
-
car.image ? /* @__PURE__ */ jsx97("img", { src: car.image, alt: "", className: "fb-photo size-full object-contain p-6" }) : /* @__PURE__ */ jsx97("div", { className: "grid size-full place-items-center text-muted-foreground", "aria-hidden": "true", children: /* @__PURE__ */ jsx97(CarIcon, { className: "size-14 opacity-30", strokeWidth: 1 }) }),
|
|
7013
|
+
car.image ? /* @__PURE__ */ jsx97("img", { src: car.image, alt: "", className: "fb-photo absolute inset-0 size-full object-contain p-6" }) : /* @__PURE__ */ jsx97("div", { className: "grid size-full place-items-center text-muted-foreground", "aria-hidden": "true", children: /* @__PURE__ */ jsx97(CarIcon, { className: "size-14 opacity-30", strokeWidth: 1 }) }),
|
|
6948
7014
|
hasLogo && /* @__PURE__ */ jsx97("span", { className: "absolute top-3 right-3 flex h-9 max-w-[40%] items-center rounded-lg bg-card/90 px-2.5 shadow-sm", children: /* @__PURE__ */ jsx97(
|
|
6949
7015
|
"img",
|
|
6950
7016
|
{
|
|
@@ -7038,26 +7104,6 @@ function Leg({
|
|
|
7038
7104
|
] });
|
|
7039
7105
|
}
|
|
7040
7106
|
|
|
7041
|
-
// src/store/customerStore.ts
|
|
7042
|
-
import { create as create2 } from "zustand";
|
|
7043
|
-
import { persist } from "zustand/middleware";
|
|
7044
|
-
var useCustomerStore = create2()(
|
|
7045
|
-
persist(
|
|
7046
|
-
(set) => ({
|
|
7047
|
-
customerId: null,
|
|
7048
|
-
driver: null,
|
|
7049
|
-
remember: (customerId, driver) => {
|
|
7050
|
-
if (!customerId) return;
|
|
7051
|
-
set({ customerId, driver });
|
|
7052
|
-
},
|
|
7053
|
-
forget: () => set({ customerId: null, driver: null })
|
|
7054
|
-
}),
|
|
7055
|
-
{
|
|
7056
|
-
name: "fb:tenant:customer"
|
|
7057
|
-
}
|
|
7058
|
-
)
|
|
7059
|
-
);
|
|
7060
|
-
|
|
7061
7107
|
// src/components/BookingWizard/PriceSummary.tsx
|
|
7062
7108
|
import { Info } from "lucide-react";
|
|
7063
7109
|
import { Fragment as Fragment8, jsx as jsx99, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
@@ -8747,8 +8793,12 @@ function revealField(id) {
|
|
|
8747
8793
|
}
|
|
8748
8794
|
function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode = "book", resumePayment }) {
|
|
8749
8795
|
const isQuote = !amend && mode === "quote";
|
|
8750
|
-
|
|
8751
|
-
|
|
8796
|
+
useEffect14(() => {
|
|
8797
|
+
try {
|
|
8798
|
+
window.localStorage.removeItem("fb:tenant:customer");
|
|
8799
|
+
} catch {
|
|
8800
|
+
}
|
|
8801
|
+
}, []);
|
|
8752
8802
|
const [stepId, setStepId] = useState17("extras");
|
|
8753
8803
|
const [payChoice, setPayChoice] = useState17(null);
|
|
8754
8804
|
const [pendingPayment, setPendingPayment] = useState17(null);
|
|
@@ -8757,7 +8807,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
8757
8807
|
const [paymentCheck, setPaymentCheck] = useState17(null);
|
|
8758
8808
|
const [checkRound, setCheckRound] = useState17(0);
|
|
8759
8809
|
const [selection, setSelection] = useState17({});
|
|
8760
|
-
const [driver, setDriver] = useState17(
|
|
8810
|
+
const [driver, setDriver] = useState17(EMPTY_DRIVER);
|
|
8761
8811
|
const [errors, setErrors] = useState17({});
|
|
8762
8812
|
const [acceptsTerms, setAcceptsTerms] = useState17(false);
|
|
8763
8813
|
const [termsError, setTermsError] = useState17(false);
|
|
@@ -8895,7 +8945,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
8895
8945
|
setPaymentCheck(null);
|
|
8896
8946
|
setSummaryOpen(false);
|
|
8897
8947
|
setSelection({});
|
|
8898
|
-
setDriver({ ...EMPTY_DRIVER, ...
|
|
8948
|
+
setDriver({ ...EMPTY_DRIVER, ...amend?.driverPrefill ?? {} });
|
|
8899
8949
|
setErrors({});
|
|
8900
8950
|
setAcceptsTerms(false);
|
|
8901
8951
|
setTermsError(false);
|
|
@@ -9130,6 +9180,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9130
9180
|
total: quote.total,
|
|
9131
9181
|
dropOffFee,
|
|
9132
9182
|
deposit: quote.deposit,
|
|
9183
|
+
excess: quote.excess,
|
|
9133
9184
|
terms: supplierTerms ? { id: supplierTerms.id, version: supplierTerms.version } : null,
|
|
9134
9185
|
payment: withPayment && payChoice ? payChoice : null
|
|
9135
9186
|
},
|
|
@@ -9171,7 +9222,6 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9171
9222
|
if (amend?.onComplete && bookingResult.booking) {
|
|
9172
9223
|
amend.onComplete(bookingResult.booking);
|
|
9173
9224
|
}
|
|
9174
|
-
if (!amend) rememberCustomer(bookingResult.customerId, driver);
|
|
9175
9225
|
setStepId("done");
|
|
9176
9226
|
toast2({
|
|
9177
9227
|
title: amend ? "Booking updated" : "Booking confirmed",
|
|
@@ -9264,6 +9314,20 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9264
9314
|
] })
|
|
9265
9315
|
] }, leg.label)) });
|
|
9266
9316
|
const renderPriceLines = () => /* @__PURE__ */ jsxs68("div", { children: [
|
|
9317
|
+
quote.deposit > 0 && /* @__PURE__ */ jsxs68("div", { className: "mb-4 rounded-xl bg-muted/60 px-3 py-2.5", children: [
|
|
9318
|
+
/* @__PURE__ */ jsx111("p", { className: "text-[0.75rem] font-semibold text-foreground", children: "On your card at pick-up" }),
|
|
9319
|
+
/* @__PURE__ */ jsxs68("div", { className: "mt-2 flex items-baseline justify-between gap-3 text-[0.8125rem]", children: [
|
|
9320
|
+
/* @__PURE__ */ jsx111("span", { className: "text-muted-foreground", children: "Deposit (refundable)" }),
|
|
9321
|
+
/* @__PURE__ */ jsx111("span", { className: "fb-tabular font-semibold text-foreground", children: formatZAR(quote.deposit) })
|
|
9322
|
+
] }),
|
|
9323
|
+
/* @__PURE__ */ jsxs68("div", { className: "mt-2 flex items-baseline justify-between gap-3 border-t border-dashed border-border-strong pt-2", children: [
|
|
9324
|
+
/* @__PURE__ */ jsxs68("div", { children: [
|
|
9325
|
+
/* @__PURE__ */ jsx111("p", { className: "text-[0.875rem] font-semibold text-foreground", children: "Funds needed on card" }),
|
|
9326
|
+
/* @__PURE__ */ jsx111("p", { className: "text-[0.6875rem] text-muted-foreground", children: "Total + refundable deposit" })
|
|
9327
|
+
] }),
|
|
9328
|
+
/* @__PURE__ */ jsx111("span", { className: "fb-tabular text-[1rem] font-extrabold text-foreground", children: formatZAR(quote.total + quote.deposit) })
|
|
9329
|
+
] })
|
|
9330
|
+
] }),
|
|
9267
9331
|
priceLook === "table" && /* @__PURE__ */ jsx111(PriceMix, { quote, className: "mb-3.5 h-1.5" }),
|
|
9268
9332
|
/* @__PURE__ */ jsx111("div", { className: "flex flex-col gap-2.5", children: /* @__PURE__ */ jsx111(AnimatePresence3, { initial: false, mode: "popLayout", children: quote.lines.map((line) => /* @__PURE__ */ jsxs68(
|
|
9269
9333
|
motion9.div,
|
|
@@ -9299,20 +9363,29 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9299
9363
|
},
|
|
9300
9364
|
line.id
|
|
9301
9365
|
)) }) }),
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
/* @__PURE__ */
|
|
9366
|
+
/* @__PURE__ */ jsxs68("div", { className: "mt-3 flex items-baseline justify-between gap-3 border-t border-border pt-3", children: [
|
|
9367
|
+
/* @__PURE__ */ jsxs68("p", { className: "text-[0.875rem] font-semibold text-foreground", children: [
|
|
9368
|
+
"Total",
|
|
9369
|
+
quote.days > 0 && /* @__PURE__ */ jsxs68("span", { className: "ml-1.5 font-normal text-muted-foreground", children: [
|
|
9370
|
+
"\xB7 ",
|
|
9371
|
+
quote.days,
|
|
9372
|
+
" ",
|
|
9373
|
+
quote.days === 1 ? "day" : "days"
|
|
9374
|
+
] })
|
|
9306
9375
|
] }),
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9376
|
+
/* @__PURE__ */ jsx111("p", { className: "fb-tabular text-[0.9375rem] font-bold text-foreground", children: formatZAR(quote.total) })
|
|
9377
|
+
] }),
|
|
9378
|
+
quote.excess > 0 && /* @__PURE__ */ jsxs68("div", { className: "mt-6 border-t border-border pt-4", children: [
|
|
9379
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
9380
|
+
/* @__PURE__ */ jsx111("p", { className: "text-[0.8125rem] font-semibold text-foreground", children: "Damage excess" }),
|
|
9381
|
+
/* @__PURE__ */ jsx111("p", { className: "fb-tabular text-[0.8125rem] font-bold text-foreground", children: formatZAR(quote.excess) })
|
|
9310
9382
|
] }),
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9383
|
+
/* @__PURE__ */ jsx111("p", { className: "mt-1 text-[0.75rem] leading-snug text-muted-foreground", children: "The most you would pay towards repairs if the car is damaged. It is not charged unless damage happens." })
|
|
9384
|
+
] }),
|
|
9385
|
+
quote.notes.filter((note) => !/mileage/i.test(note.label)).length > 0 && /* @__PURE__ */ jsx111("dl", { className: "mt-4 flex flex-col gap-1.5 text-[0.75rem]", children: quote.notes.filter((note) => !/mileage/i.test(note.label)).map((note) => /* @__PURE__ */ jsxs68("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
9386
|
+
/* @__PURE__ */ jsx111("dt", { className: "text-muted-foreground", children: note.label }),
|
|
9387
|
+
/* @__PURE__ */ jsx111("dd", { className: "fb-tabular text-right text-foreground", children: note.value })
|
|
9388
|
+
] }, note.label)) })
|
|
9316
9389
|
] });
|
|
9317
9390
|
return /* @__PURE__ */ jsx111(Sheet, { open, onOpenChange: (next) => !next && requestClose(), children: /* @__PURE__ */ jsxs68(
|
|
9318
9391
|
SheetContent,
|
|
@@ -9555,7 +9628,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9555
9628
|
type: "tel",
|
|
9556
9629
|
value: driver.phone,
|
|
9557
9630
|
onChange: (event) => patchDriver({ phone: event.target.value }),
|
|
9558
|
-
autoComplete: "tel",
|
|
9631
|
+
autoComplete: "tel-national",
|
|
9559
9632
|
placeholder: "082-123-4567",
|
|
9560
9633
|
"aria-invalid": Boolean(errors.phone),
|
|
9561
9634
|
className: cn(INPUT, "rounded-l-none")
|
|
@@ -9587,6 +9660,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9587
9660
|
onChange: (event) => patchDriver({ idNumber: event.target.value }),
|
|
9588
9661
|
inputMode: isSouthAfrica ? "numeric" : "text",
|
|
9589
9662
|
maxLength: isSouthAfrica ? 13 : void 0,
|
|
9663
|
+
autoComplete: "off",
|
|
9590
9664
|
"aria-invalid": Boolean(errors.idNumber),
|
|
9591
9665
|
className: INPUT
|
|
9592
9666
|
}
|
|
@@ -9597,6 +9671,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9597
9671
|
id: "fb-licence",
|
|
9598
9672
|
value: driver.licenceNumber,
|
|
9599
9673
|
onChange: (event) => patchDriver({ licenceNumber: event.target.value }),
|
|
9674
|
+
autoComplete: "off",
|
|
9600
9675
|
className: INPUT
|
|
9601
9676
|
}
|
|
9602
9677
|
) }),
|
|
@@ -9976,7 +10051,7 @@ function BookingWizard({ car, criteria, days, onClose, onEditSearch, amend, mode
|
|
|
9976
10051
|
/* @__PURE__ */ jsxs68("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
9977
10052
|
/* @__PURE__ */ jsxs68(motion9.div, { variants: summaryBlockVariants, className: "p-4", children: [
|
|
9978
10053
|
/* @__PURE__ */ jsxs68("div", { className: "flex items-start gap-3", children: [
|
|
9979
|
-
/* @__PURE__ */ jsx111("div", { className: "relative
|
|
10054
|
+
/* @__PURE__ */ jsx111("div", { className: "relative h-16 w-24 shrink-0 overflow-hidden rounded-lg bg-car-photo", children: car.image ? /* @__PURE__ */ jsx111("img", { src: car.image, alt: "", className: "fb-photo absolute inset-0 size-full object-contain p-1.5" }) : /* @__PURE__ */ jsx111(CarIcon5, { className: "absolute top-1/2 left-1/2 size-6 -translate-x-1/2 -translate-y-1/2 text-muted-foreground opacity-40", strokeWidth: 1.25, "aria-hidden": "true" }) }),
|
|
9980
10055
|
/* @__PURE__ */ jsxs68("div", { className: "min-w-0 flex-1", children: [
|
|
9981
10056
|
/* @__PURE__ */ jsx111("p", { className: "text-[0.9375rem] leading-snug font-semibold text-foreground", children: carName }),
|
|
9982
10057
|
/* @__PURE__ */ jsx111("p", { className: "mt-0.5 truncate text-[0.75rem] text-muted-foreground", children: [group && `Group ${group}`, bodyCategory && displayName(bodyCategory), car.supplier.name].filter(Boolean).join(" \xB7 ") }),
|
|
@@ -10166,7 +10241,7 @@ import { RotateCcw, SearchX } from "lucide-react";
|
|
|
10166
10241
|
// src/components/CarCard/index.tsx
|
|
10167
10242
|
import { useEffect as useEffect16, useRef as useRef9 } from "react";
|
|
10168
10243
|
import { AnimatePresence as AnimatePresence4, motion as motion10, useReducedMotion as useReducedMotion3 } from "framer-motion";
|
|
10169
|
-
import { BadgePercent as BadgePercent2, Car as CarIcon8
|
|
10244
|
+
import { BadgePercent as BadgePercent2, Car as CarIcon8 } from "lucide-react";
|
|
10170
10245
|
|
|
10171
10246
|
// src/components/CarCard/helpers.ts
|
|
10172
10247
|
function bookingHref(bookingUrl, car) {
|
|
@@ -10196,30 +10271,17 @@ function sentenceTitle(value) {
|
|
|
10196
10271
|
}).join("");
|
|
10197
10272
|
}
|
|
10198
10273
|
|
|
10199
|
-
// src/components/CarCard/PriceRow.tsx
|
|
10200
|
-
import { jsx as jsx112, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
10201
|
-
function PriceRow({
|
|
10202
|
-
label: label2,
|
|
10203
|
-
children,
|
|
10204
|
-
emphasize = false
|
|
10205
|
-
}) {
|
|
10206
|
-
return /* @__PURE__ */ jsxs69("div", { className: "flex items-baseline justify-between gap-3 text-[0.75rem]", children: [
|
|
10207
|
-
/* @__PURE__ */ jsx112("dt", { className: "shrink-0 text-car-muted", children: label2 }),
|
|
10208
|
-
/* @__PURE__ */ jsx112("dd", { className: cn("fb-tabular text-right text-car-title", emphasize ? "font-bold" : "font-semibold"), children })
|
|
10209
|
-
] });
|
|
10210
|
-
}
|
|
10211
|
-
|
|
10212
10274
|
// src/components/CarCard/CardActions.tsx
|
|
10213
10275
|
import { ArrowRight as ArrowRight5, MessageSquareQuote } from "lucide-react";
|
|
10214
|
-
import { jsx as
|
|
10276
|
+
import { jsx as jsx112, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
10215
10277
|
function CardActions({
|
|
10216
10278
|
onBookClick,
|
|
10217
10279
|
onQuoteClick,
|
|
10218
10280
|
bookLabel,
|
|
10219
10281
|
className
|
|
10220
10282
|
}) {
|
|
10221
|
-
return /* @__PURE__ */
|
|
10222
|
-
/* @__PURE__ */
|
|
10283
|
+
return /* @__PURE__ */ jsxs69("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
10284
|
+
/* @__PURE__ */ jsxs69(
|
|
10223
10285
|
Button,
|
|
10224
10286
|
{
|
|
10225
10287
|
type: "button",
|
|
@@ -10228,11 +10290,11 @@ function CardActions({
|
|
|
10228
10290
|
className: "fb-focus h-9 w-full gap-1.5 rounded-lg bg-car-cta text-[0.6875rem] font-semibold tracking-[0.08em] text-car-cta-fg uppercase shadow-sm transition-[background-color,transform] duration-150 hover:bg-car-cta/90 active:scale-[0.98]",
|
|
10229
10291
|
children: [
|
|
10230
10292
|
bookLabel ?? "Book now",
|
|
10231
|
-
/* @__PURE__ */
|
|
10293
|
+
/* @__PURE__ */ jsx112(ArrowRight5, { "data-icon": "inline-end", className: "size-3.5 transition-transform duration-200 group-hover:translate-x-0.5", "aria-hidden": "true" })
|
|
10232
10294
|
]
|
|
10233
10295
|
}
|
|
10234
10296
|
),
|
|
10235
|
-
onQuoteClick ? /* @__PURE__ */
|
|
10297
|
+
onQuoteClick ? /* @__PURE__ */ jsxs69(
|
|
10236
10298
|
Button,
|
|
10237
10299
|
{
|
|
10238
10300
|
type: "button",
|
|
@@ -10241,7 +10303,7 @@ function CardActions({
|
|
|
10241
10303
|
onClick: onQuoteClick,
|
|
10242
10304
|
className: "fb-focus h-8 w-full gap-1.5 rounded-lg border-car-quote-border bg-transparent text-[0.6875rem] font-medium text-car-muted transition-[background-color,transform] duration-150 hover:bg-car-photo hover:text-car-title active:scale-[0.98]",
|
|
10243
10305
|
children: [
|
|
10244
|
-
/* @__PURE__ */
|
|
10306
|
+
/* @__PURE__ */ jsx112(MessageSquareQuote, { className: "size-3.5 opacity-70", "aria-hidden": "true" }),
|
|
10245
10307
|
"Request a quote"
|
|
10246
10308
|
]
|
|
10247
10309
|
}
|
|
@@ -10250,44 +10312,44 @@ function CardActions({
|
|
|
10250
10312
|
}
|
|
10251
10313
|
|
|
10252
10314
|
// src/components/CarCard/OfferParts.tsx
|
|
10253
|
-
import { BadgePercent, Briefcase as Briefcase4, Car as CarIcon6,
|
|
10315
|
+
import { BadgePercent, Briefcase as Briefcase4, Car as CarIcon6, Cog as Cog4, DoorOpen as DoorOpen3, Gauge as Gauge4, Infinity as InfinityIcon3, Users as Users5 } from "lucide-react";
|
|
10254
10316
|
|
|
10255
10317
|
// src/components/CarCard/Spec.tsx
|
|
10256
|
-
import { jsx as
|
|
10318
|
+
import { jsx as jsx113, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
10257
10319
|
function Spec({
|
|
10258
10320
|
icon: Icon,
|
|
10259
10321
|
label: label2,
|
|
10260
10322
|
children
|
|
10261
10323
|
}) {
|
|
10262
|
-
return /* @__PURE__ */
|
|
10324
|
+
return /* @__PURE__ */ jsxs70(
|
|
10263
10325
|
"li",
|
|
10264
10326
|
{
|
|
10265
10327
|
title: label2,
|
|
10266
10328
|
"aria-label": label2,
|
|
10267
10329
|
className: "flex shrink-0 items-center gap-1 text-[0.6875rem] font-medium whitespace-nowrap text-car-muted",
|
|
10268
10330
|
children: [
|
|
10269
|
-
/* @__PURE__ */
|
|
10270
|
-
/* @__PURE__ */
|
|
10331
|
+
/* @__PURE__ */ jsx113(Icon, { className: "size-3 shrink-0", "aria-hidden": "true", strokeWidth: 1.75 }),
|
|
10332
|
+
/* @__PURE__ */ jsx113("span", { children })
|
|
10271
10333
|
]
|
|
10272
10334
|
}
|
|
10273
10335
|
);
|
|
10274
10336
|
}
|
|
10275
10337
|
|
|
10276
10338
|
// src/components/CarCard/OfferParts.tsx
|
|
10277
|
-
import { Fragment as Fragment13, jsx as
|
|
10339
|
+
import { Fragment as Fragment13, jsx as jsx114, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
10278
10340
|
function SpecList({ car, className }) {
|
|
10279
|
-
return /* @__PURE__ */
|
|
10280
|
-
car.seats > 0 && /* @__PURE__ */
|
|
10281
|
-
car.doors > 0 && /* @__PURE__ */
|
|
10282
|
-
car.transmission && /* @__PURE__ */
|
|
10283
|
-
car.luggage != null && car.luggage > 0 && /* @__PURE__ */
|
|
10284
|
-
/* @__PURE__ */
|
|
10341
|
+
return /* @__PURE__ */ jsxs71("ul", { className: cn("flex flex-wrap items-center gap-x-2.5 gap-y-1", className), "aria-label": "Key features", children: [
|
|
10342
|
+
car.seats > 0 && /* @__PURE__ */ jsx114(Spec, { icon: Users5, label: `${car.seats} seats`, children: /* @__PURE__ */ jsx114("span", { className: "fb-tabular", children: car.seats }) }),
|
|
10343
|
+
car.doors > 0 && /* @__PURE__ */ jsx114(Spec, { icon: DoorOpen3, label: `${car.doors} doors`, children: /* @__PURE__ */ jsx114("span", { className: "fb-tabular", children: car.doors }) }),
|
|
10344
|
+
car.transmission && /* @__PURE__ */ jsx114(Spec, { icon: Cog4, label: car.transmission, children: car.transmission === "Automatic" ? "Auto" : car.transmission }),
|
|
10345
|
+
car.luggage != null && car.luggage > 0 && /* @__PURE__ */ jsx114(Spec, { icon: Briefcase4, label: `${car.luggage} ${car.luggage === 1 ? "bag" : "bags"}`, children: /* @__PURE__ */ jsx114("span", { className: "fb-tabular", children: car.luggage }) }),
|
|
10346
|
+
/* @__PURE__ */ jsx114(
|
|
10285
10347
|
Spec,
|
|
10286
10348
|
{
|
|
10287
10349
|
icon: car.unlimitedMileage ? InfinityIcon3 : Gauge4,
|
|
10288
10350
|
label: car.unlimitedMileage ? "Unlimited kilometres" : `${car.kmPerDay} km per day`,
|
|
10289
|
-
children: car.unlimitedMileage ? "Unlimited" : /* @__PURE__ */
|
|
10290
|
-
/* @__PURE__ */
|
|
10351
|
+
children: car.unlimitedMileage ? "Unlimited" : /* @__PURE__ */ jsxs71(Fragment13, { children: [
|
|
10352
|
+
/* @__PURE__ */ jsx114("span", { className: "fb-tabular", children: car.kmPerDay }),
|
|
10291
10353
|
" km/d"
|
|
10292
10354
|
] })
|
|
10293
10355
|
}
|
|
@@ -10301,8 +10363,8 @@ function CarPhoto({
|
|
|
10301
10363
|
imageClassName,
|
|
10302
10364
|
children
|
|
10303
10365
|
}) {
|
|
10304
|
-
return /* @__PURE__ */
|
|
10305
|
-
offer.hasPhoto ? /* @__PURE__ */
|
|
10366
|
+
return /* @__PURE__ */ jsxs71("div", { className: cn("relative overflow-hidden rounded-lg bg-car-photo", offer.hasPhoto && !offer.imageLoaded && "fb-skeleton", className), children: [
|
|
10367
|
+
offer.hasPhoto ? /* @__PURE__ */ jsx114(
|
|
10306
10368
|
"img",
|
|
10307
10369
|
{
|
|
10308
10370
|
src: offer.photoSrc,
|
|
@@ -10314,13 +10376,13 @@ function CarPhoto({
|
|
|
10314
10376
|
"data-loaded": offer.imageLoaded,
|
|
10315
10377
|
className: cn("fb-zoom fb-photo size-full object-contain px-3 py-2", imageClassName)
|
|
10316
10378
|
}
|
|
10317
|
-
) : /* @__PURE__ */
|
|
10379
|
+
) : /* @__PURE__ */ jsx114("div", { className: "grid size-full place-items-center text-car-muted", "aria-hidden": "true", children: /* @__PURE__ */ jsx114(CarIcon6, { className: "size-7 opacity-25", strokeWidth: 1.25 }) }),
|
|
10318
10380
|
children
|
|
10319
10381
|
] });
|
|
10320
10382
|
}
|
|
10321
10383
|
function SupplierLogo({ offer, className }) {
|
|
10322
10384
|
if (!offer.hasLogo) return null;
|
|
10323
|
-
return /* @__PURE__ */
|
|
10385
|
+
return /* @__PURE__ */ jsx114(
|
|
10324
10386
|
"img",
|
|
10325
10387
|
{
|
|
10326
10388
|
src: offer.display.supplier.logoUrl,
|
|
@@ -10332,7 +10394,7 @@ function SupplierLogo({ offer, className }) {
|
|
|
10332
10394
|
}
|
|
10333
10395
|
function PromoBadge({ offer, className }) {
|
|
10334
10396
|
if (!offer.showPromo) return null;
|
|
10335
|
-
return /* @__PURE__ */
|
|
10397
|
+
return /* @__PURE__ */ jsxs71(
|
|
10336
10398
|
"span",
|
|
10337
10399
|
{
|
|
10338
10400
|
className: cn(
|
|
@@ -10340,7 +10402,7 @@ function PromoBadge({ offer, className }) {
|
|
|
10340
10402
|
className
|
|
10341
10403
|
),
|
|
10342
10404
|
children: [
|
|
10343
|
-
/* @__PURE__ */
|
|
10405
|
+
/* @__PURE__ */ jsx114(BadgePercent, { className: "size-3", strokeWidth: 2.25, "aria-hidden": "true" }),
|
|
10344
10406
|
offer.showWasPrice ? `Save ${offer.percentOff}%` : "Save"
|
|
10345
10407
|
]
|
|
10346
10408
|
}
|
|
@@ -10348,17 +10410,17 @@ function PromoBadge({ offer, className }) {
|
|
|
10348
10410
|
}
|
|
10349
10411
|
function GroupLine({ offer, className }) {
|
|
10350
10412
|
if (!offer.group && !offer.bodyCategory) return null;
|
|
10351
|
-
return /* @__PURE__ */
|
|
10352
|
-
offer.group && /* @__PURE__ */
|
|
10413
|
+
return /* @__PURE__ */ jsxs71("div", { className: cn("flex min-w-0 items-center gap-1.5", className), children: [
|
|
10414
|
+
offer.group && /* @__PURE__ */ jsxs71("span", { className: "shrink-0 rounded-md bg-car-badge px-1.5 py-0.5 text-[0.5625rem] font-bold tracking-[0.06em] text-car-badge-fg uppercase", children: [
|
|
10353
10415
|
"Group ",
|
|
10354
10416
|
offer.group
|
|
10355
10417
|
] }),
|
|
10356
|
-
offer.bodyCategory && /* @__PURE__ */
|
|
10418
|
+
offer.bodyCategory && /* @__PURE__ */ jsx114("span", { className: "truncate text-[0.625rem] font-semibold tracking-[0.08em] text-car-muted uppercase", children: offer.bodyCategory })
|
|
10357
10419
|
] });
|
|
10358
10420
|
}
|
|
10359
10421
|
function MileageOptions({ offer, className }) {
|
|
10360
10422
|
if (offer.rateOptions.length < 2 || !offer.selectedPkg) return null;
|
|
10361
|
-
return /* @__PURE__ */
|
|
10423
|
+
return /* @__PURE__ */ jsx114(
|
|
10362
10424
|
Segmented,
|
|
10363
10425
|
{
|
|
10364
10426
|
className: cn("gap-0 rounded-md bg-car-photo p-0.5", className),
|
|
@@ -10378,7 +10440,7 @@ function MileageOptions({ offer, className }) {
|
|
|
10378
10440
|
}
|
|
10379
10441
|
function CoverOptions({ offer, className }) {
|
|
10380
10442
|
if (!offer.selectedPkg?.superCover) return null;
|
|
10381
|
-
return /* @__PURE__ */
|
|
10443
|
+
return /* @__PURE__ */ jsx114(
|
|
10382
10444
|
Segmented,
|
|
10383
10445
|
{
|
|
10384
10446
|
className: cn("gap-0 rounded-md bg-car-photo p-0.5", className),
|
|
@@ -10397,12 +10459,12 @@ function CoverOptions({ offer, className }) {
|
|
|
10397
10459
|
}
|
|
10398
10460
|
function DailyPrice({ offer, size = "md", className }) {
|
|
10399
10461
|
const { display } = offer;
|
|
10400
|
-
return /* @__PURE__ */
|
|
10401
|
-
offer.showWasPrice && /* @__PURE__ */
|
|
10402
|
-
/* @__PURE__ */
|
|
10462
|
+
return /* @__PURE__ */ jsxs71("p", { className: cn("flex flex-wrap items-baseline gap-x-1.5 leading-none", className), children: [
|
|
10463
|
+
offer.showWasPrice && /* @__PURE__ */ jsxs71("span", { className: "fb-tabular text-[0.75rem] text-car-muted line-through", children: [
|
|
10464
|
+
/* @__PURE__ */ jsx114("span", { className: "sr-only", children: "was " }),
|
|
10403
10465
|
formatZAR(display.wasDailyRate)
|
|
10404
10466
|
] }),
|
|
10405
|
-
/* @__PURE__ */
|
|
10467
|
+
/* @__PURE__ */ jsx114(
|
|
10406
10468
|
"span",
|
|
10407
10469
|
{
|
|
10408
10470
|
ref: offer.priceRef,
|
|
@@ -10413,77 +10475,61 @@ function DailyPrice({ offer, size = "md", className }) {
|
|
|
10413
10475
|
children: formatZAR(display.dailyRate)
|
|
10414
10476
|
}
|
|
10415
10477
|
),
|
|
10416
|
-
/* @__PURE__ */
|
|
10478
|
+
/* @__PURE__ */ jsx114("span", { className: "text-[0.75rem] text-car-muted", children: "/day" })
|
|
10417
10479
|
] });
|
|
10418
10480
|
}
|
|
10419
10481
|
function TotalWithBreakdown({ offer, className }) {
|
|
10420
10482
|
const { display } = offer;
|
|
10421
10483
|
if (display.totalRate <= 0) return null;
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
"aria-hidden": "true"
|
|
10430
|
-
}
|
|
10431
|
-
)
|
|
10432
|
-
] });
|
|
10433
|
-
return /* @__PURE__ */ jsxs72("div", { className, children: [
|
|
10434
|
-
offer.hasCostBreakdown ? /* @__PURE__ */ jsxs72(
|
|
10435
|
-
"button",
|
|
10436
|
-
{
|
|
10437
|
-
type: "button",
|
|
10438
|
-
onClick: () => offer.setShowBreakdown((open) => !open),
|
|
10439
|
-
"aria-expanded": offer.showBreakdown,
|
|
10440
|
-
"aria-controls": offer.breakdownId,
|
|
10441
|
-
className: "fb-focus -mx-1 flex w-[calc(100%+0.5rem)] items-center justify-between gap-2 rounded-md px-1 py-1 text-[0.6875rem] transition-colors hover:bg-car-photo",
|
|
10442
|
-
children: [
|
|
10443
|
-
/* @__PURE__ */ jsx115("span", { className: "font-semibold tracking-[0.06em] text-car-title uppercase", children: offer.totalLabel }),
|
|
10444
|
-
amount
|
|
10445
|
-
]
|
|
10446
|
-
}
|
|
10447
|
-
) : /* @__PURE__ */ jsxs72("div", { className: "flex items-center justify-between gap-2 py-1 text-[0.6875rem]", children: [
|
|
10448
|
-
/* @__PURE__ */ jsx115("span", { className: "font-semibold tracking-[0.06em] text-car-title uppercase", children: offer.totalLabel }),
|
|
10449
|
-
amount
|
|
10484
|
+
return /* @__PURE__ */ jsx114("div", { className, children: /* @__PURE__ */ jsxs71("div", { className: "mt-2 rounded-xl bg-car-photo px-2.5 py-2", children: [
|
|
10485
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
10486
|
+
/* @__PURE__ */ jsx114("span", { className: "text-[0.75rem] text-car-muted", children: offer.totalLabel }),
|
|
10487
|
+
/* @__PURE__ */ jsxs71("span", { className: "flex items-baseline gap-1.5", children: [
|
|
10488
|
+
offer.showWasPrice && /* @__PURE__ */ jsx114("span", { className: "fb-tabular text-[0.75rem] text-car-muted line-through", children: formatZAR(display.wasTotalRate) }),
|
|
10489
|
+
/* @__PURE__ */ jsx114("span", { className: "fb-tabular text-[0.8125rem] font-bold text-car-price", children: formatZAR(display.totalRate) })
|
|
10490
|
+
] })
|
|
10450
10491
|
] }),
|
|
10451
|
-
|
|
10452
|
-
"
|
|
10453
|
-
{
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
|
|
10460
|
-
offer.fundsNeeded > 0 && /* @__PURE__ */ jsx115(PriceRow, { label: "Funds needed on card", emphasize: true, children: formatZAR(offer.fundsNeeded) })
|
|
10461
|
-
] }) })
|
|
10462
|
-
}
|
|
10463
|
-
)
|
|
10464
|
-
] });
|
|
10492
|
+
display.deposit > 0 && /* @__PURE__ */ jsxs71("div", { className: "mt-1 flex items-baseline justify-between gap-3", children: [
|
|
10493
|
+
/* @__PURE__ */ jsx114("span", { className: "text-[0.75rem] text-car-muted", children: "Deposit (refundable)" }),
|
|
10494
|
+
/* @__PURE__ */ jsx114("span", { className: "fb-tabular text-[0.8125rem] font-bold text-car-price", children: formatZAR(display.deposit) })
|
|
10495
|
+
] }),
|
|
10496
|
+
offer.fundsNeeded > display.totalRate && /* @__PURE__ */ jsxs71("div", { className: "mt-1.5 flex items-baseline justify-between gap-3 border-t border-dashed border-black/20 pt-2 dark:border-white/25", children: [
|
|
10497
|
+
/* @__PURE__ */ jsx114("span", { className: "text-[0.8125rem] font-semibold text-car-title", children: "Funds needed on card" }),
|
|
10498
|
+
/* @__PURE__ */ jsx114("span", { className: "fb-tabular text-[1rem] font-extrabold text-car-price", children: formatZAR(offer.fundsNeeded) })
|
|
10499
|
+
] })
|
|
10500
|
+
] }) });
|
|
10465
10501
|
}
|
|
10466
10502
|
|
|
10467
10503
|
// src/components/CarCard/useCarOffer.ts
|
|
10468
10504
|
import { useEffect as useEffect15, useMemo as useMemo10, useRef as useRef8, useState as useState18 } from "react";
|
|
10505
|
+
function dedupePackages(packages) {
|
|
10506
|
+
if (!packages?.length) return [];
|
|
10507
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10508
|
+
return packages.filter((pkg) => {
|
|
10509
|
+
const key = packageKey(pkg);
|
|
10510
|
+
if (seen.has(key)) return false;
|
|
10511
|
+
seen.add(key);
|
|
10512
|
+
return true;
|
|
10513
|
+
});
|
|
10514
|
+
}
|
|
10469
10515
|
function useCarOffer(car, { bookingUrl, onBook, onQuote, rentalDays: rentalDays2 }) {
|
|
10470
10516
|
const [imageLoaded, setImageLoaded] = useState18(false);
|
|
10471
10517
|
const [imageFailed, setImageFailed] = useState18(false);
|
|
10472
10518
|
const [logoFailed, setLogoFailed] = useState18(false);
|
|
10473
|
-
const [packageIndex, setPackageIndex] = useState18(
|
|
10519
|
+
const [packageIndex, setPackageIndex] = useState18(() => selectedPackageIndex(car, dedupePackages(car.packages)));
|
|
10474
10520
|
const [tier, setTier] = useState18("standard");
|
|
10475
10521
|
const [showBreakdown, setShowBreakdown] = useState18(false);
|
|
10476
10522
|
const priceRef = useRef8(null);
|
|
10477
10523
|
const pricePulsed = useRef8(false);
|
|
10478
10524
|
useEffect15(() => {
|
|
10479
|
-
setPackageIndex(
|
|
10525
|
+
setPackageIndex(selectedPackageIndex(car, dedupePackages(car.packages)));
|
|
10480
10526
|
setTier("standard");
|
|
10481
10527
|
setImageLoaded(false);
|
|
10482
10528
|
setImageFailed(false);
|
|
10483
10529
|
setLogoFailed(false);
|
|
10484
10530
|
setShowBreakdown(false);
|
|
10485
10531
|
pricePulsed.current = false;
|
|
10486
|
-
}, [car.id]);
|
|
10532
|
+
}, [car.id, car.kmPerDay, car.unlimitedMileage, car.rateNo]);
|
|
10487
10533
|
useEffect15(() => {
|
|
10488
10534
|
setTier("standard");
|
|
10489
10535
|
}, [packageIndex]);
|
|
@@ -10494,17 +10540,7 @@ function useCarOffer(car, { bookingUrl, onBook, onQuote, rentalDays: rentalDays2
|
|
|
10494
10540
|
}
|
|
10495
10541
|
if (priceRef.current) pulseValue(priceRef.current);
|
|
10496
10542
|
}, [packageIndex, tier]);
|
|
10497
|
-
const rateOptions = useMemo10(() =>
|
|
10498
|
-
const packages = car.packages?.length ? car.packages : [];
|
|
10499
|
-
if (!packages.length) return [];
|
|
10500
|
-
const seen = /* @__PURE__ */ new Set();
|
|
10501
|
-
return packages.filter((pkg) => {
|
|
10502
|
-
const key = packageKey(pkg);
|
|
10503
|
-
if (seen.has(key)) return false;
|
|
10504
|
-
seen.add(key);
|
|
10505
|
-
return true;
|
|
10506
|
-
});
|
|
10507
|
-
}, [car.packages]);
|
|
10543
|
+
const rateOptions = useMemo10(() => dedupePackages(car.packages), [car.packages]);
|
|
10508
10544
|
const selectedPkg = rateOptions[packageIndex] ?? rateOptions[0];
|
|
10509
10545
|
const display = selectedPkg ? withPackage(car, selectedPkg, tier) : car;
|
|
10510
10546
|
const photoSrc = display.image && !/notfound|place-holders?\//i.test(display.image) ? display.image : "";
|
|
@@ -10517,7 +10553,7 @@ function useCarOffer(car, { bookingUrl, onBook, onQuote, rentalDays: rentalDays2
|
|
|
10517
10553
|
const days = display.rentalDays ?? rentalDays2;
|
|
10518
10554
|
const fundsNeeded = display.totalRate + display.deposit + display.dropOffFee;
|
|
10519
10555
|
const hasCostBreakdown = display.deposit > 0 || display.liability > 0 || display.dropOffFee > 0 || fundsNeeded > 0;
|
|
10520
|
-
const totalLabel = days != null && days > 0 ? `Total
|
|
10556
|
+
const totalLabel = days != null && days > 0 ? `Total for ${days} ${days === 1 ? "day" : "days"}` : "Total";
|
|
10521
10557
|
const showWasPrice = Boolean(display.wasDailyRate) && display.wasDailyRate > display.dailyRate;
|
|
10522
10558
|
const showPromo = display.isDiscounted || showWasPrice;
|
|
10523
10559
|
const percentOff = showWasPrice ? Math.round((display.wasDailyRate / display.dailyRate - 1) * 100) : 0;
|
|
@@ -10575,29 +10611,29 @@ function useCarOffer(car, { bookingUrl, onBook, onQuote, rentalDays: rentalDays2
|
|
|
10575
10611
|
|
|
10576
10612
|
// src/components/CarCard/CarCardSkeleton.tsx
|
|
10577
10613
|
import { Car as CarIcon7 } from "lucide-react";
|
|
10578
|
-
import { jsx as
|
|
10614
|
+
import { jsx as jsx115, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
10579
10615
|
function CarCardSkeleton() {
|
|
10580
|
-
return /* @__PURE__ */
|
|
10616
|
+
return /* @__PURE__ */ jsxs72(
|
|
10581
10617
|
"div",
|
|
10582
10618
|
{
|
|
10583
10619
|
"aria-hidden": "true",
|
|
10584
10620
|
className: "flex h-full w-full flex-col overflow-hidden rounded-2xl border border-car-border bg-car-bg p-3 shadow-car",
|
|
10585
10621
|
children: [
|
|
10586
|
-
/* @__PURE__ */
|
|
10587
|
-
/* @__PURE__ */
|
|
10588
|
-
/* @__PURE__ */
|
|
10622
|
+
/* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-1.5", children: [
|
|
10623
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton h-4 w-14 rounded-md" }),
|
|
10624
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton h-2.5 w-12 rounded-sm" })
|
|
10589
10625
|
] }),
|
|
10590
|
-
/* @__PURE__ */
|
|
10591
|
-
/* @__PURE__ */
|
|
10592
|
-
/* @__PURE__ */
|
|
10593
|
-
/* @__PURE__ */
|
|
10594
|
-
/* @__PURE__ */
|
|
10595
|
-
/* @__PURE__ */
|
|
10596
|
-
/* @__PURE__ */
|
|
10597
|
-
/* @__PURE__ */
|
|
10598
|
-
/* @__PURE__ */
|
|
10626
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton mt-2 h-4 w-2/3 rounded-sm" }),
|
|
10627
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton mt-1.5 h-3 w-2/5 rounded-sm" }),
|
|
10628
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton relative mt-2.5 aspect-[12/5] rounded-lg", children: /* @__PURE__ */ jsx115("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ jsx115(CarIcon7, { className: "size-7 text-car-muted/20", strokeWidth: 1.25, "aria-hidden": "true" }) }) }),
|
|
10629
|
+
/* @__PURE__ */ jsx115("div", { className: "mt-2.5 flex gap-2.5", children: [1, 2, 3, 4, 5].map((item) => /* @__PURE__ */ jsx115("div", { className: "fb-skeleton h-3 w-6 rounded-sm" }, item)) }),
|
|
10630
|
+
/* @__PURE__ */ jsxs72("div", { className: "mt-auto pt-2.5", children: [
|
|
10631
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton h-5 w-24 rounded-sm" }),
|
|
10632
|
+
/* @__PURE__ */ jsxs72("div", { className: "mt-2 flex items-center justify-between", children: [
|
|
10633
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton h-3 w-20 rounded-sm" }),
|
|
10634
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton h-3 w-14 rounded-sm" })
|
|
10599
10635
|
] }),
|
|
10600
|
-
/* @__PURE__ */
|
|
10636
|
+
/* @__PURE__ */ jsx115("div", { className: "fb-skeleton mt-2.5 h-9 w-full rounded-lg" })
|
|
10601
10637
|
] })
|
|
10602
10638
|
]
|
|
10603
10639
|
}
|
|
@@ -10605,7 +10641,7 @@ function CarCardSkeleton() {
|
|
|
10605
10641
|
}
|
|
10606
10642
|
|
|
10607
10643
|
// src/components/CarCard/index.tsx
|
|
10608
|
-
import { jsx as
|
|
10644
|
+
import { jsx as jsx116, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
10609
10645
|
function CarCard({
|
|
10610
10646
|
car,
|
|
10611
10647
|
bookingUrl,
|
|
@@ -10636,15 +10672,11 @@ function CarCard({
|
|
|
10636
10672
|
setImageFailed,
|
|
10637
10673
|
hasLogo,
|
|
10638
10674
|
setLogoFailed,
|
|
10639
|
-
fundsNeeded,
|
|
10640
|
-
hasCostBreakdown,
|
|
10641
10675
|
totalLabel,
|
|
10676
|
+
fundsNeeded,
|
|
10642
10677
|
showWasPrice,
|
|
10643
10678
|
showPromo,
|
|
10644
10679
|
percentOff,
|
|
10645
|
-
showBreakdown,
|
|
10646
|
-
setShowBreakdown,
|
|
10647
|
-
breakdownId,
|
|
10648
10680
|
priceRef,
|
|
10649
10681
|
onBookClick,
|
|
10650
10682
|
onQuoteClick
|
|
@@ -10652,7 +10684,7 @@ function CarCard({
|
|
|
10652
10684
|
useEffect16(() => {
|
|
10653
10685
|
promoReady.current = true;
|
|
10654
10686
|
}, [packageIndex]);
|
|
10655
|
-
return /* @__PURE__ */
|
|
10687
|
+
return /* @__PURE__ */ jsxs73(
|
|
10656
10688
|
"article",
|
|
10657
10689
|
{
|
|
10658
10690
|
"aria-label": title,
|
|
@@ -10662,15 +10694,15 @@ function CarCard({
|
|
|
10662
10694
|
className
|
|
10663
10695
|
),
|
|
10664
10696
|
children: [
|
|
10665
|
-
/* @__PURE__ */
|
|
10666
|
-
/* @__PURE__ */
|
|
10667
|
-
group && /* @__PURE__ */
|
|
10697
|
+
/* @__PURE__ */ jsxs73("div", { className: "flex items-center justify-between gap-2", children: [
|
|
10698
|
+
/* @__PURE__ */ jsxs73("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
10699
|
+
group && /* @__PURE__ */ jsxs73("span", { className: "shrink-0 rounded-md bg-car-badge px-1.5 py-0.5 text-[0.5625rem] font-bold tracking-[0.06em] text-car-badge-fg uppercase", children: [
|
|
10668
10700
|
"Group ",
|
|
10669
10701
|
group
|
|
10670
10702
|
] }),
|
|
10671
|
-
bodyCategory && /* @__PURE__ */
|
|
10703
|
+
bodyCategory && /* @__PURE__ */ jsx116("span", { className: "truncate text-[0.625rem] font-semibold tracking-[0.08em] text-car-muted uppercase", children: bodyCategory })
|
|
10672
10704
|
] }),
|
|
10673
|
-
selectedPkg?.superCover && /* @__PURE__ */
|
|
10705
|
+
selectedPkg?.superCover && /* @__PURE__ */ jsx116(
|
|
10674
10706
|
Segmented,
|
|
10675
10707
|
{
|
|
10676
10708
|
className: "w-[11.75rem] shrink-0 gap-0 rounded-md bg-car-photo p-0.5",
|
|
@@ -10687,9 +10719,28 @@ function CarCard({
|
|
|
10687
10719
|
}
|
|
10688
10720
|
)
|
|
10689
10721
|
] }),
|
|
10690
|
-
/* @__PURE__ */
|
|
10691
|
-
|
|
10692
|
-
|
|
10722
|
+
/* @__PURE__ */ jsxs73("div", { className: "mt-2 flex items-start justify-between gap-3", children: [
|
|
10723
|
+
/* @__PURE__ */ jsxs73("div", { className: "min-w-0", children: [
|
|
10724
|
+
/* @__PURE__ */ jsx116("h3", { className: "truncate text-[1.0625rem] leading-tight font-semibold tracking-[-0.02em] text-car-title", children: title }),
|
|
10725
|
+
/* @__PURE__ */ jsx116("p", { className: "mt-0.5 truncate text-[0.75rem] text-car-muted", children: display.location.hub })
|
|
10726
|
+
] }),
|
|
10727
|
+
/* @__PURE__ */ jsxs73("p", { className: "flex shrink-0 items-baseline gap-1 whitespace-nowrap leading-none", children: [
|
|
10728
|
+
showWasPrice && /* @__PURE__ */ jsxs73("span", { className: "fb-tabular mr-0.5 text-[0.75rem] text-car-muted line-through", children: [
|
|
10729
|
+
/* @__PURE__ */ jsx116("span", { className: "sr-only", children: "was " }),
|
|
10730
|
+
formatZAR(display.wasDailyRate)
|
|
10731
|
+
] }),
|
|
10732
|
+
/* @__PURE__ */ jsx116(
|
|
10733
|
+
"span",
|
|
10734
|
+
{
|
|
10735
|
+
ref: priceRef,
|
|
10736
|
+
className: "fb-tabular inline-block text-[1.125rem] font-bold tracking-[-0.03em] text-car-price",
|
|
10737
|
+
children: formatZAR(display.dailyRate)
|
|
10738
|
+
}
|
|
10739
|
+
),
|
|
10740
|
+
/* @__PURE__ */ jsx116("span", { className: "text-[0.75rem] text-car-muted", children: "/day" })
|
|
10741
|
+
] })
|
|
10742
|
+
] }),
|
|
10743
|
+
/* @__PURE__ */ jsxs73(
|
|
10693
10744
|
"div",
|
|
10694
10745
|
{
|
|
10695
10746
|
className: cn(
|
|
@@ -10697,7 +10748,7 @@ function CarCard({
|
|
|
10697
10748
|
hasPhoto && !imageLoaded && "fb-skeleton"
|
|
10698
10749
|
),
|
|
10699
10750
|
children: [
|
|
10700
|
-
hasPhoto ? /* @__PURE__ */
|
|
10751
|
+
hasPhoto ? /* @__PURE__ */ jsx116(
|
|
10701
10752
|
"img",
|
|
10702
10753
|
{
|
|
10703
10754
|
src: photoSrc,
|
|
@@ -10709,14 +10760,14 @@ function CarCard({
|
|
|
10709
10760
|
"data-loaded": imageLoaded,
|
|
10710
10761
|
className: "fb-zoom fb-photo size-full object-contain px-3 py-2"
|
|
10711
10762
|
}
|
|
10712
|
-
) : /* @__PURE__ */
|
|
10713
|
-
/* @__PURE__ */
|
|
10763
|
+
) : /* @__PURE__ */ jsx116("div", { className: "grid size-full place-items-center text-car-muted", "aria-hidden": "true", children: /* @__PURE__ */ jsx116(CarIcon8, { className: "size-7 opacity-25", strokeWidth: 1.25 }) }),
|
|
10764
|
+
/* @__PURE__ */ jsx116(AnimatePresence4, { initial: false, children: showPromo && // The band stays clipped in the corner. Only the label travels,
|
|
10714
10765
|
// by its own height, when the km package changes — moving the
|
|
10715
10766
|
// rotated ribbon sweeps it across the photo. The new label uses
|
|
10716
10767
|
// duration.fast so it can settle; the old one uses duration.micro
|
|
10717
10768
|
// so the pair stays inside 0.4s. ease.standard, not a spring:
|
|
10718
10769
|
// bounce inside this short clip reads as jitter.
|
|
10719
|
-
/* @__PURE__ */
|
|
10770
|
+
/* @__PURE__ */ jsx116(
|
|
10720
10771
|
motion10.span,
|
|
10721
10772
|
{
|
|
10722
10773
|
initial: promoReady.current && !reduceMotion ? { opacity: 0 } : false,
|
|
@@ -10724,7 +10775,7 @@ function CarCard({
|
|
|
10724
10775
|
exit: { opacity: 0 },
|
|
10725
10776
|
transition: { duration: reduceMotion ? 0 : duration.micro },
|
|
10726
10777
|
className: "pointer-events-none absolute top-5 -left-9 z-10 flex w-36 -rotate-45 overflow-hidden bg-car-cta py-1 text-[0.625rem] font-semibold tracking-[0.14em] text-car-cta-fg uppercase shadow-[0_10px_18px_-8px_rgb(0_0_0/0.55)]",
|
|
10727
|
-
children: /* @__PURE__ */
|
|
10778
|
+
children: /* @__PURE__ */ jsx116(AnimatePresence4, { initial: false, mode: "wait", children: /* @__PURE__ */ jsxs73(
|
|
10728
10779
|
motion10.span,
|
|
10729
10780
|
{
|
|
10730
10781
|
initial: promoReady.current && !reduceMotion ? { y: "-110%" } : false,
|
|
@@ -10735,7 +10786,7 @@ function CarCard({
|
|
|
10735
10786
|
exit: reduceMotion ? { transition: { duration: 0 } } : { y: "110%", transition: { duration: duration.micro, ease: ease.exit } },
|
|
10736
10787
|
className: "flex w-full items-center justify-center gap-1",
|
|
10737
10788
|
children: [
|
|
10738
|
-
/* @__PURE__ */
|
|
10789
|
+
/* @__PURE__ */ jsx116(BadgePercent2, { className: "size-3", strokeWidth: 2.25, "aria-hidden": "true" }),
|
|
10739
10790
|
showWasPrice ? `Save ${percentOff}%` : "Save"
|
|
10740
10791
|
]
|
|
10741
10792
|
},
|
|
@@ -10743,7 +10794,7 @@ function CarCard({
|
|
|
10743
10794
|
) })
|
|
10744
10795
|
}
|
|
10745
10796
|
) }),
|
|
10746
|
-
hasLogo && /* @__PURE__ */
|
|
10797
|
+
hasLogo && /* @__PURE__ */ jsx116(
|
|
10747
10798
|
"img",
|
|
10748
10799
|
{
|
|
10749
10800
|
src: display.supplier.logoUrl,
|
|
@@ -10755,8 +10806,8 @@ function CarCard({
|
|
|
10755
10806
|
]
|
|
10756
10807
|
}
|
|
10757
10808
|
),
|
|
10758
|
-
/* @__PURE__ */
|
|
10759
|
-
rateOptions.length > 1 && /* @__PURE__ */
|
|
10809
|
+
/* @__PURE__ */ jsx116(SpecList, { car: display, className: "mt-2.5" }),
|
|
10810
|
+
rateOptions.length > 1 && /* @__PURE__ */ jsx116(
|
|
10760
10811
|
Segmented,
|
|
10761
10812
|
{
|
|
10762
10813
|
className: "-mx-3 mt-2.5 w-[calc(100%+1.5rem)] gap-0 rounded-none bg-car-photo p-0",
|
|
@@ -10773,69 +10824,25 @@ function CarCard({
|
|
|
10773
10824
|
}))
|
|
10774
10825
|
}
|
|
10775
10826
|
),
|
|
10776
|
-
/* @__PURE__ */
|
|
10777
|
-
/* @__PURE__ */
|
|
10778
|
-
|
|
10779
|
-
/* @__PURE__ */
|
|
10780
|
-
|
|
10827
|
+
/* @__PURE__ */ jsxs73("footer", { className: "mt-auto pt-1.5", children: [
|
|
10828
|
+
display.totalRate > 0 && /* @__PURE__ */ jsxs73("div", { className: "rounded-xl bg-car-photo px-2.5 py-2", children: [
|
|
10829
|
+
/* @__PURE__ */ jsxs73("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
10830
|
+
/* @__PURE__ */ jsx116("span", { className: "text-[0.75rem] text-car-muted", children: totalLabel }),
|
|
10831
|
+
/* @__PURE__ */ jsxs73("span", { className: "flex items-baseline gap-1.5", children: [
|
|
10832
|
+
showWasPrice && /* @__PURE__ */ jsx116("span", { className: "fb-tabular text-[0.75rem] text-car-muted line-through", children: formatZAR(display.wasTotalRate) }),
|
|
10833
|
+
/* @__PURE__ */ jsx116("span", { className: "fb-tabular text-[0.8125rem] font-bold text-car-price", children: formatZAR(display.totalRate) })
|
|
10834
|
+
] })
|
|
10781
10835
|
] }),
|
|
10782
|
-
/* @__PURE__ */
|
|
10783
|
-
"span",
|
|
10784
|
-
{
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
}
|
|
10789
|
-
),
|
|
10790
|
-
/* @__PURE__ */ jsx117("span", { className: "text-[0.75rem] text-car-muted", children: "/day" })
|
|
10791
|
-
] }),
|
|
10792
|
-
display.totalRate > 0 && (hasCostBreakdown ? /* @__PURE__ */ jsxs74(
|
|
10793
|
-
"button",
|
|
10794
|
-
{
|
|
10795
|
-
type: "button",
|
|
10796
|
-
onClick: () => setShowBreakdown((open) => !open),
|
|
10797
|
-
"aria-expanded": showBreakdown,
|
|
10798
|
-
"aria-controls": breakdownId,
|
|
10799
|
-
className: "fb-focus mt-1.5 -mx-1 flex w-[calc(100%+0.5rem)] items-center justify-between gap-2 rounded-md px-1 py-1 text-[0.6875rem] transition-colors hover:bg-car-photo",
|
|
10800
|
-
children: [
|
|
10801
|
-
/* @__PURE__ */ jsx117("span", { className: "font-semibold tracking-[0.06em] text-car-title uppercase", children: totalLabel }),
|
|
10802
|
-
/* @__PURE__ */ jsxs74("span", { className: "flex items-center gap-1.5", children: [
|
|
10803
|
-
showWasPrice && /* @__PURE__ */ jsx117("span", { className: "fb-tabular text-car-muted line-through", children: formatZAR(display.wasTotalRate) }),
|
|
10804
|
-
/* @__PURE__ */ jsx117("span", { className: "fb-tabular text-[0.8125rem] font-semibold text-car-price", children: formatZAR(display.totalRate) }),
|
|
10805
|
-
/* @__PURE__ */ jsx117(
|
|
10806
|
-
ChevronDown3,
|
|
10807
|
-
{
|
|
10808
|
-
className: cn("size-3.5 text-car-muted transition-transform duration-200", showBreakdown && "rotate-180"),
|
|
10809
|
-
"aria-hidden": "true"
|
|
10810
|
-
}
|
|
10811
|
-
)
|
|
10812
|
-
] })
|
|
10813
|
-
]
|
|
10814
|
-
}
|
|
10815
|
-
) : /* @__PURE__ */ jsxs74("div", { className: "mt-1.5 flex items-center justify-between gap-2 py-1 text-[0.6875rem]", children: [
|
|
10816
|
-
/* @__PURE__ */ jsx117("span", { className: "font-semibold tracking-[0.06em] text-car-title uppercase", children: totalLabel }),
|
|
10817
|
-
/* @__PURE__ */ jsxs74("span", { className: "flex items-center gap-1.5", children: [
|
|
10818
|
-
showWasPrice && /* @__PURE__ */ jsx117("span", { className: "fb-tabular text-car-muted line-through", children: formatZAR(display.wasTotalRate) }),
|
|
10819
|
-
/* @__PURE__ */ jsx117("span", { className: "fb-tabular text-[0.8125rem] font-semibold text-car-price", children: formatZAR(display.totalRate) })
|
|
10836
|
+
display.deposit > 0 && /* @__PURE__ */ jsxs73("div", { className: "mt-1 flex items-baseline justify-between gap-3", children: [
|
|
10837
|
+
/* @__PURE__ */ jsx116("span", { className: "text-[0.75rem] text-car-muted", children: "Deposit (refundable)" }),
|
|
10838
|
+
/* @__PURE__ */ jsx116("span", { className: "fb-tabular text-[0.8125rem] font-bold text-car-price", children: formatZAR(display.deposit) })
|
|
10839
|
+
] }),
|
|
10840
|
+
fundsNeeded > display.totalRate && /* @__PURE__ */ jsxs73("div", { className: "mt-1.5 flex items-baseline justify-between gap-3 border-t border-dashed border-black/20 pt-2 dark:border-white/25", children: [
|
|
10841
|
+
/* @__PURE__ */ jsx116("span", { className: "text-[0.8125rem] font-semibold text-car-title", children: "Funds needed on card" }),
|
|
10842
|
+
/* @__PURE__ */ jsx116("span", { className: "fb-tabular text-[1rem] font-extrabold text-car-price", children: formatZAR(fundsNeeded) })
|
|
10820
10843
|
] })
|
|
10821
|
-
] })
|
|
10822
|
-
|
|
10823
|
-
"div",
|
|
10824
|
-
{
|
|
10825
|
-
id: breakdownId,
|
|
10826
|
-
className: cn(
|
|
10827
|
-
"grid transition-[grid-template-rows] duration-300 ease-out",
|
|
10828
|
-
showBreakdown ? "mt-1.5 grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
10829
|
-
),
|
|
10830
|
-
children: /* @__PURE__ */ jsx117("div", { className: "overflow-hidden rounded-lg bg-car-photo", children: /* @__PURE__ */ jsxs74("dl", { className: "space-y-1 px-2.5 py-2", children: [
|
|
10831
|
-
display.deposit > 0 && /* @__PURE__ */ jsx117(PriceRow, { label: "Deposit (refundable)", emphasize: true, children: formatZAR(display.deposit) }),
|
|
10832
|
-
display.liability > 0 && /* @__PURE__ */ jsx117(PriceRow, { label: "Excess", children: formatZAR(display.liability) }),
|
|
10833
|
-
display.dropOffFee > 0 && /* @__PURE__ */ jsx117(PriceRow, { label: "One-way fee", children: formatZAR(display.dropOffFee) }),
|
|
10834
|
-
fundsNeeded > 0 && /* @__PURE__ */ jsx117(PriceRow, { label: "Funds needed on card", emphasize: true, children: formatZAR(fundsNeeded) })
|
|
10835
|
-
] }) })
|
|
10836
|
-
}
|
|
10837
|
-
),
|
|
10838
|
-
/* @__PURE__ */ jsx117(
|
|
10844
|
+
] }),
|
|
10845
|
+
/* @__PURE__ */ jsx116(
|
|
10839
10846
|
CardActions,
|
|
10840
10847
|
{
|
|
10841
10848
|
onBookClick,
|
|
@@ -10855,7 +10862,7 @@ var GRID_CLASSES = "grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-3.5 xl:grid-col
|
|
|
10855
10862
|
|
|
10856
10863
|
// src/components/CarList/styles/GroupedStyle.tsx
|
|
10857
10864
|
import { useMemo as useMemo11 } from "react";
|
|
10858
|
-
import { jsx as
|
|
10865
|
+
import { jsx as jsx117, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
10859
10866
|
function groupNameFor(car) {
|
|
10860
10867
|
const group = (car.carGroup || "").toUpperCase();
|
|
10861
10868
|
const category = car.category?.trim() ?? "";
|
|
@@ -10871,26 +10878,26 @@ function GroupedStyle({ cars, ...item }) {
|
|
|
10871
10878
|
}
|
|
10872
10879
|
return [...byName.entries()].map(([name, list]) => ({ name, cars: list, from: Math.min(...list.map((car) => car.dailyRate)) })).sort((a, b) => a.from - b.from);
|
|
10873
10880
|
}, [cars]);
|
|
10874
|
-
return /* @__PURE__ */
|
|
10875
|
-
/* @__PURE__ */
|
|
10881
|
+
return /* @__PURE__ */ jsx117("div", { className: "grid gap-6", children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs74("section", { "aria-label": group.name, className: "min-w-0", children: [
|
|
10882
|
+
/* @__PURE__ */ jsxs74("h3", { className: "mb-2.5 flex flex-wrap items-baseline gap-x-2.5 text-[1.0625rem] font-semibold tracking-[-0.01em] text-car-title", children: [
|
|
10876
10883
|
group.name,
|
|
10877
|
-
/* @__PURE__ */
|
|
10878
|
-
/* @__PURE__ */
|
|
10884
|
+
/* @__PURE__ */ jsxs74("span", { className: "text-[0.8125rem] font-normal text-car-muted", children: [
|
|
10885
|
+
/* @__PURE__ */ jsx117("span", { className: "fb-tabular", children: group.cars.length }),
|
|
10879
10886
|
" ",
|
|
10880
10887
|
group.cars.length === 1 ? "car" : "cars",
|
|
10881
10888
|
" \xB7 from",
|
|
10882
10889
|
" ",
|
|
10883
|
-
/* @__PURE__ */
|
|
10890
|
+
/* @__PURE__ */ jsx117("span", { className: "fb-tabular", children: formatZAR(group.from) }),
|
|
10884
10891
|
" a day"
|
|
10885
10892
|
] })
|
|
10886
10893
|
] }),
|
|
10887
|
-
/* @__PURE__ */
|
|
10894
|
+
/* @__PURE__ */ jsx117("div", { className: "-mx-1 flex snap-x snap-mandatory gap-3 overflow-x-auto px-1 pb-2 [scrollbar-width:thin]", children: group.cars.map((car, index) => /* @__PURE__ */ jsx117("div", { "data-car-card": true, className: "fb-hidden flex w-[15.5rem] shrink-0 snap-start", children: /* @__PURE__ */ jsx117(CompactCard, { car, priority: groupIndex === 0 && index < 3, ...item }) }, car.id)) })
|
|
10888
10895
|
] }, group.name)) });
|
|
10889
10896
|
}
|
|
10890
10897
|
function CompactCard({ car, priority, bookLabel, ...options }) {
|
|
10891
10898
|
const offer = useCarOffer(car, options);
|
|
10892
10899
|
const { display } = offer;
|
|
10893
|
-
return /* @__PURE__ */
|
|
10900
|
+
return /* @__PURE__ */ jsxs74(
|
|
10894
10901
|
"article",
|
|
10895
10902
|
{
|
|
10896
10903
|
"aria-label": offer.title,
|
|
@@ -10899,16 +10906,16 @@ function CompactCard({ car, priority, bookLabel, ...options }) {
|
|
|
10899
10906
|
"transition-[border-color,box-shadow] duration-200 hover:border-car-border-hover hover:shadow-car-hover"
|
|
10900
10907
|
),
|
|
10901
10908
|
children: [
|
|
10902
|
-
/* @__PURE__ */
|
|
10903
|
-
/* @__PURE__ */
|
|
10904
|
-
/* @__PURE__ */
|
|
10905
|
-
/* @__PURE__ */
|
|
10909
|
+
/* @__PURE__ */ jsx117(CarPhoto, { offer, priority, className: "aspect-[16/9]", children: /* @__PURE__ */ jsx117(PromoBadge, { offer, className: "absolute top-2 left-2 z-10" }) }),
|
|
10910
|
+
/* @__PURE__ */ jsxs74("div", { className: "min-w-0", children: [
|
|
10911
|
+
/* @__PURE__ */ jsx117("h4", { className: "truncate text-[0.9375rem] leading-tight font-semibold tracking-[-0.01em] text-car-title", children: offer.title }),
|
|
10912
|
+
/* @__PURE__ */ jsx117("p", { className: "mt-0.5 truncate text-[0.75rem] text-car-muted", children: display.supplier.name })
|
|
10906
10913
|
] }),
|
|
10907
|
-
/* @__PURE__ */
|
|
10908
|
-
/* @__PURE__ */
|
|
10909
|
-
/* @__PURE__ */
|
|
10910
|
-
/* @__PURE__ */
|
|
10911
|
-
/* @__PURE__ */
|
|
10914
|
+
/* @__PURE__ */ jsx117(SpecList, { car: display }),
|
|
10915
|
+
/* @__PURE__ */ jsx117(MileageOptions, { offer }),
|
|
10916
|
+
/* @__PURE__ */ jsxs74("div", { className: "mt-auto grid gap-2 pt-1", children: [
|
|
10917
|
+
/* @__PURE__ */ jsx117(DailyPrice, { offer, size: "sm" }),
|
|
10918
|
+
/* @__PURE__ */ jsx117(CardActions, { onBookClick: offer.onBookClick, onQuoteClick: offer.onQuoteClick, bookLabel })
|
|
10912
10919
|
] })
|
|
10913
10920
|
]
|
|
10914
10921
|
}
|
|
@@ -10916,14 +10923,14 @@ function CompactCard({ car, priority, bookLabel, ...options }) {
|
|
|
10916
10923
|
}
|
|
10917
10924
|
|
|
10918
10925
|
// src/components/CarList/styles/RowsStyle.tsx
|
|
10919
|
-
import { jsx as
|
|
10926
|
+
import { jsx as jsx118, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
10920
10927
|
function RowsStyle({ cars, ...item }) {
|
|
10921
|
-
return /* @__PURE__ */
|
|
10928
|
+
return /* @__PURE__ */ jsx118("div", { className: "grid gap-3", children: cars.map((car, index) => /* @__PURE__ */ jsx118("div", { "data-car-card": true, className: "fb-hidden", children: /* @__PURE__ */ jsx118(CarRow, { car, priority: index < 4, ...item }) }, car.id)) });
|
|
10922
10929
|
}
|
|
10923
10930
|
function CarRow({ car, priority, bookLabel, ...options }) {
|
|
10924
10931
|
const offer = useCarOffer(car, options);
|
|
10925
10932
|
const { display } = offer;
|
|
10926
|
-
return /* @__PURE__ */
|
|
10933
|
+
return /* @__PURE__ */ jsxs75(
|
|
10927
10934
|
"article",
|
|
10928
10935
|
{
|
|
10929
10936
|
"aria-label": offer.title,
|
|
@@ -10933,24 +10940,24 @@ function CarRow({ car, priority, bookLabel, ...options }) {
|
|
|
10933
10940
|
"@lg/list:grid-cols-[11rem_minmax(0,1fr)] @lg/list:gap-4 @3xl/list:grid-cols-[13rem_minmax(0,1fr)_13rem]"
|
|
10934
10941
|
),
|
|
10935
10942
|
children: [
|
|
10936
|
-
/* @__PURE__ */
|
|
10937
|
-
/* @__PURE__ */
|
|
10938
|
-
/* @__PURE__ */
|
|
10943
|
+
/* @__PURE__ */ jsxs75(CarPhoto, { offer, priority, className: "aspect-[16/9] self-start @lg/list:aspect-[4/3] @3xl/list:aspect-[16/11]", children: [
|
|
10944
|
+
/* @__PURE__ */ jsx118(PromoBadge, { offer, className: "absolute top-2 left-2 z-10" }),
|
|
10945
|
+
/* @__PURE__ */ jsx118(SupplierLogo, { offer })
|
|
10939
10946
|
] }),
|
|
10940
|
-
/* @__PURE__ */
|
|
10941
|
-
/* @__PURE__ */
|
|
10942
|
-
/* @__PURE__ */
|
|
10943
|
-
/* @__PURE__ */
|
|
10944
|
-
/* @__PURE__ */
|
|
10945
|
-
(offer.rateOptions.length > 1 || offer.selectedPkg?.superCover) && /* @__PURE__ */
|
|
10946
|
-
/* @__PURE__ */
|
|
10947
|
-
/* @__PURE__ */
|
|
10947
|
+
/* @__PURE__ */ jsxs75("div", { className: "grid min-w-0 content-start gap-1.5", children: [
|
|
10948
|
+
/* @__PURE__ */ jsx118(GroupLine, { offer }),
|
|
10949
|
+
/* @__PURE__ */ jsx118("h3", { className: "truncate text-[1.0625rem] leading-tight font-semibold tracking-[-0.02em] text-car-title", children: offer.title }),
|
|
10950
|
+
/* @__PURE__ */ jsx118("p", { className: "truncate text-[0.75rem] text-car-muted", children: display.location.hub }),
|
|
10951
|
+
/* @__PURE__ */ jsx118(SpecList, { car: display, className: "mt-1" }),
|
|
10952
|
+
(offer.rateOptions.length > 1 || offer.selectedPkg?.superCover) && /* @__PURE__ */ jsxs75("div", { className: "mt-1.5 flex flex-wrap gap-2", children: [
|
|
10953
|
+
/* @__PURE__ */ jsx118(MileageOptions, { offer, className: "w-full max-w-[16rem]" }),
|
|
10954
|
+
/* @__PURE__ */ jsx118(CoverOptions, { offer, className: "w-full max-w-[13rem]" })
|
|
10948
10955
|
] })
|
|
10949
10956
|
] }),
|
|
10950
|
-
/* @__PURE__ */
|
|
10951
|
-
/* @__PURE__ */
|
|
10952
|
-
/* @__PURE__ */
|
|
10953
|
-
/* @__PURE__ */
|
|
10957
|
+
/* @__PURE__ */ jsxs75("div", { className: "grid content-center gap-1.5 border-t border-car-border pt-3 @lg/list:col-span-2 @3xl/list:col-span-1 @3xl/list:border-t-0 @3xl/list:border-l @3xl/list:pt-0 @3xl/list:pl-4", children: [
|
|
10958
|
+
/* @__PURE__ */ jsx118(DailyPrice, { offer, size: "lg" }),
|
|
10959
|
+
/* @__PURE__ */ jsx118(TotalWithBreakdown, { offer }),
|
|
10960
|
+
/* @__PURE__ */ jsx118(CardActions, { onBookClick: offer.onBookClick, onQuoteClick: offer.onQuoteClick, bookLabel, className: "mt-1" })
|
|
10954
10961
|
] })
|
|
10955
10962
|
]
|
|
10956
10963
|
}
|
|
@@ -10959,14 +10966,14 @@ function CarRow({ car, priority, bookLabel, ...options }) {
|
|
|
10959
10966
|
|
|
10960
10967
|
// src/components/CarList/styles/ShowcaseStyle.tsx
|
|
10961
10968
|
import { ArrowRight as ArrowRight6, MessageSquareQuote as MessageSquareQuote2 } from "lucide-react";
|
|
10962
|
-
import { jsx as
|
|
10969
|
+
import { jsx as jsx119, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
10963
10970
|
function ShowcaseStyle({ cars, ...item }) {
|
|
10964
|
-
return /* @__PURE__ */
|
|
10971
|
+
return /* @__PURE__ */ jsx119("div", { className: "grid gap-4 @2xl/list:grid-cols-2", children: cars.map((car, index) => /* @__PURE__ */ jsx119("div", { "data-car-card": true, className: "fb-hidden flex", children: /* @__PURE__ */ jsx119(ShowcaseCard, { car, priority: index < 2, ...item }) }, car.id)) });
|
|
10965
10972
|
}
|
|
10966
10973
|
function ShowcaseCard({ car, priority, bookLabel, ...options }) {
|
|
10967
10974
|
const offer = useCarOffer(car, options);
|
|
10968
10975
|
const { display } = offer;
|
|
10969
|
-
return /* @__PURE__ */
|
|
10976
|
+
return /* @__PURE__ */ jsxs76(
|
|
10970
10977
|
"article",
|
|
10971
10978
|
{
|
|
10972
10979
|
"aria-label": offer.title,
|
|
@@ -10975,43 +10982,43 @@ function ShowcaseCard({ car, priority, bookLabel, ...options }) {
|
|
|
10975
10982
|
"transition-[border-color,box-shadow] duration-200 hover:border-car-border-hover hover:shadow-car-hover"
|
|
10976
10983
|
),
|
|
10977
10984
|
children: [
|
|
10978
|
-
/* @__PURE__ */
|
|
10979
|
-
/* @__PURE__ */
|
|
10980
|
-
/* @__PURE__ */
|
|
10985
|
+
/* @__PURE__ */ jsxs76(CarPhoto, { offer, priority, className: "aspect-[16/9] rounded-none", imageClassName: "px-8 py-5", children: [
|
|
10986
|
+
/* @__PURE__ */ jsx119(PromoBadge, { offer, className: "absolute top-3 left-3 z-10" }),
|
|
10987
|
+
/* @__PURE__ */ jsx119(SupplierLogo, { offer, className: "top-3 right-3" })
|
|
10981
10988
|
] }),
|
|
10982
|
-
/* @__PURE__ */
|
|
10983
|
-
/* @__PURE__ */
|
|
10984
|
-
/* @__PURE__ */
|
|
10985
|
-
/* @__PURE__ */
|
|
10986
|
-
/* @__PURE__ */
|
|
10987
|
-
/* @__PURE__ */
|
|
10989
|
+
/* @__PURE__ */ jsxs76("div", { className: "flex flex-1 flex-col gap-3 p-4 sm:p-5", children: [
|
|
10990
|
+
/* @__PURE__ */ jsxs76("div", { className: "flex items-end justify-between gap-4", children: [
|
|
10991
|
+
/* @__PURE__ */ jsxs76("div", { className: "min-w-0", children: [
|
|
10992
|
+
/* @__PURE__ */ jsx119(GroupLine, { offer, className: "mb-1.5" }),
|
|
10993
|
+
/* @__PURE__ */ jsx119("h3", { className: "truncate text-[1.375rem] leading-tight font-semibold tracking-[-0.02em] text-car-title", children: offer.title }),
|
|
10994
|
+
/* @__PURE__ */ jsx119("p", { className: "mt-0.5 truncate text-[0.8125rem] text-car-muted", children: display.supplier.name })
|
|
10988
10995
|
] }),
|
|
10989
|
-
/* @__PURE__ */
|
|
10996
|
+
/* @__PURE__ */ jsx119(
|
|
10990
10997
|
"button",
|
|
10991
10998
|
{
|
|
10992
10999
|
type: "button",
|
|
10993
11000
|
onClick: offer.onBookClick,
|
|
10994
11001
|
"aria-label": `${bookLabel ?? "Book"} ${offer.title}`,
|
|
10995
11002
|
className: "fb-focus grid size-12 shrink-0 place-items-center rounded-full bg-car-cta text-car-cta-fg shadow-sm transition-[background-color,transform] duration-150 hover:bg-car-cta/90 active:scale-95",
|
|
10996
|
-
children: /* @__PURE__ */
|
|
11003
|
+
children: /* @__PURE__ */ jsx119(ArrowRight6, { className: "size-5 transition-transform duration-200 group-hover:translate-x-0.5", "aria-hidden": "true" })
|
|
10997
11004
|
}
|
|
10998
11005
|
)
|
|
10999
11006
|
] }),
|
|
11000
|
-
/* @__PURE__ */
|
|
11001
|
-
/* @__PURE__ */
|
|
11002
|
-
/* @__PURE__ */
|
|
11007
|
+
/* @__PURE__ */ jsxs76("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-car-border pt-3", children: [
|
|
11008
|
+
/* @__PURE__ */ jsx119(SpecList, { car: display }),
|
|
11009
|
+
/* @__PURE__ */ jsx119(DailyPrice, { offer })
|
|
11003
11010
|
] }),
|
|
11004
|
-
(offer.rateOptions.length > 1 || offer.selectedPkg?.superCover || offer.onQuoteClick) && /* @__PURE__ */
|
|
11005
|
-
/* @__PURE__ */
|
|
11006
|
-
/* @__PURE__ */
|
|
11007
|
-
offer.onQuoteClick && /* @__PURE__ */
|
|
11011
|
+
(offer.rateOptions.length > 1 || offer.selectedPkg?.superCover || offer.onQuoteClick) && /* @__PURE__ */ jsxs76("div", { className: "mt-auto flex flex-wrap items-center gap-2", children: [
|
|
11012
|
+
/* @__PURE__ */ jsx119(MileageOptions, { offer, className: "min-w-[12rem] flex-1" }),
|
|
11013
|
+
/* @__PURE__ */ jsx119(CoverOptions, { offer, className: "min-w-[12rem] flex-1" }),
|
|
11014
|
+
offer.onQuoteClick && /* @__PURE__ */ jsxs76(
|
|
11008
11015
|
"button",
|
|
11009
11016
|
{
|
|
11010
11017
|
type: "button",
|
|
11011
11018
|
onClick: offer.onQuoteClick,
|
|
11012
11019
|
className: "fb-focus inline-flex h-8 items-center gap-1.5 rounded-lg px-2 text-[0.75rem] text-car-muted hover:bg-car-photo hover:text-car-title",
|
|
11013
11020
|
children: [
|
|
11014
|
-
/* @__PURE__ */
|
|
11021
|
+
/* @__PURE__ */ jsx119(MessageSquareQuote2, { className: "size-3.5 opacity-70", "aria-hidden": "true" }),
|
|
11015
11022
|
"Request a quote"
|
|
11016
11023
|
]
|
|
11017
11024
|
}
|
|
@@ -11025,55 +11032,55 @@ function ShowcaseCard({ car, priority, bookLabel, ...options }) {
|
|
|
11025
11032
|
|
|
11026
11033
|
// src/components/CarList/styles/TableStyle.tsx
|
|
11027
11034
|
import { ArrowRight as ArrowRight7, MessageSquareQuote as MessageSquareQuote3 } from "lucide-react";
|
|
11028
|
-
import { jsx as
|
|
11035
|
+
import { jsx as jsx120, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
11029
11036
|
function TableStyle({ cars, ...item }) {
|
|
11030
11037
|
const cheapest = Math.min(...cars.map((car) => car.dailyRate));
|
|
11031
|
-
return /* @__PURE__ */
|
|
11032
|
-
/* @__PURE__ */
|
|
11033
|
-
/* @__PURE__ */
|
|
11034
|
-
/* @__PURE__ */
|
|
11035
|
-
/* @__PURE__ */
|
|
11036
|
-
/* @__PURE__ */
|
|
11037
|
-
/* @__PURE__ */
|
|
11038
|
-
/* @__PURE__ */
|
|
11039
|
-
/* @__PURE__ */
|
|
11040
|
-
/* @__PURE__ */
|
|
11041
|
-
/* @__PURE__ */
|
|
11042
|
-
/* @__PURE__ */
|
|
11038
|
+
return /* @__PURE__ */ jsx120("div", { className: "overflow-x-auto rounded-2xl border border-car-border bg-car-bg shadow-car [scrollbar-width:thin]", children: /* @__PURE__ */ jsxs77("table", { className: "w-full min-w-[48rem] border-collapse text-left text-[0.8125rem]", children: [
|
|
11039
|
+
/* @__PURE__ */ jsx120("caption", { className: "sr-only", children: "Available cars, cheapest marked" }),
|
|
11040
|
+
/* @__PURE__ */ jsx120("thead", { children: /* @__PURE__ */ jsxs77("tr", { className: "bg-car-photo text-[0.625rem] font-semibold tracking-[0.08em] text-car-muted uppercase", children: [
|
|
11041
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5", children: "Car" }),
|
|
11042
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5 text-right", children: "Seats" }),
|
|
11043
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5 text-right", children: "Bags" }),
|
|
11044
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5", children: "Gearbox" }),
|
|
11045
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5", children: "Mileage" }),
|
|
11046
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5 text-right", children: "Deposit" }),
|
|
11047
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5 text-right", children: "Per day" }),
|
|
11048
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5 text-right", children: "Total" }),
|
|
11049
|
+
/* @__PURE__ */ jsx120("th", { scope: "col", className: "px-3 py-2.5", children: /* @__PURE__ */ jsx120("span", { className: "sr-only", children: "Book" }) })
|
|
11043
11050
|
] }) }),
|
|
11044
|
-
/* @__PURE__ */
|
|
11051
|
+
/* @__PURE__ */ jsx120("tbody", { children: cars.map((car, index) => /* @__PURE__ */ jsx120(TableRow, { car, priority: index < 6, cheapest: car.dailyRate === cheapest, ...item }, car.id)) })
|
|
11045
11052
|
] }) });
|
|
11046
11053
|
}
|
|
11047
11054
|
function TableRow({ car, priority, cheapest, bookLabel, ...options }) {
|
|
11048
11055
|
const offer = useCarOffer(car, options);
|
|
11049
11056
|
const { display } = offer;
|
|
11050
|
-
return /* @__PURE__ */
|
|
11051
|
-
/* @__PURE__ */
|
|
11052
|
-
/* @__PURE__ */
|
|
11053
|
-
/* @__PURE__ */
|
|
11054
|
-
/* @__PURE__ */
|
|
11055
|
-
/* @__PURE__ */
|
|
11056
|
-
/* @__PURE__ */
|
|
11057
|
-
cheapest && /* @__PURE__ */
|
|
11058
|
-
/* @__PURE__ */
|
|
11057
|
+
return /* @__PURE__ */ jsxs77("tr", { "data-car-card": true, className: cn("fb-hidden border-t border-car-border align-middle", cheapest && "bg-car-cta/5"), children: [
|
|
11058
|
+
/* @__PURE__ */ jsx120("td", { className: "px-3 py-2.5", children: /* @__PURE__ */ jsxs77("div", { className: "flex min-w-[15rem] items-center gap-3", children: [
|
|
11059
|
+
/* @__PURE__ */ jsx120(CarPhoto, { offer, priority, className: "aspect-[4/3] w-20 shrink-0 rounded-md", imageClassName: "px-1 py-1" }),
|
|
11060
|
+
/* @__PURE__ */ jsxs77("div", { className: "min-w-0", children: [
|
|
11061
|
+
/* @__PURE__ */ jsx120("p", { className: "truncate text-[0.875rem] font-semibold text-car-title", children: offer.title }),
|
|
11062
|
+
/* @__PURE__ */ jsx120("p", { className: "truncate text-[0.75rem] text-car-muted", children: [display.supplier.name, offer.group && `Group ${offer.group}`].filter(Boolean).join(" \xB7 ") }),
|
|
11063
|
+
/* @__PURE__ */ jsxs77("div", { className: "mt-1 flex flex-wrap gap-1", children: [
|
|
11064
|
+
cheapest && /* @__PURE__ */ jsx120("span", { className: "rounded-full bg-car-badge px-2 py-0.5 text-[0.5625rem] font-bold tracking-[0.06em] text-car-badge-fg uppercase", children: "Cheapest" }),
|
|
11065
|
+
/* @__PURE__ */ jsx120(PromoBadge, { offer })
|
|
11059
11066
|
] })
|
|
11060
11067
|
] })
|
|
11061
11068
|
] }) }),
|
|
11062
|
-
/* @__PURE__ */
|
|
11063
|
-
/* @__PURE__ */
|
|
11064
|
-
/* @__PURE__ */
|
|
11065
|
-
/* @__PURE__ */
|
|
11066
|
-
offer.rateOptions.length > 1 ? /* @__PURE__ */
|
|
11069
|
+
/* @__PURE__ */ jsx120("td", { className: "fb-tabular px-3 py-2.5 text-right text-car-title", children: display.seats || "\u2013" }),
|
|
11070
|
+
/* @__PURE__ */ jsx120("td", { className: "fb-tabular px-3 py-2.5 text-right text-car-title", children: display.luggage || "\u2013" }),
|
|
11071
|
+
/* @__PURE__ */ jsx120("td", { className: "px-3 py-2.5 text-car-title", children: display.transmission || "\u2013" }),
|
|
11072
|
+
/* @__PURE__ */ jsxs77("td", { className: "px-3 py-2.5 text-car-title", children: [
|
|
11073
|
+
offer.rateOptions.length > 1 ? /* @__PURE__ */ jsx120(MileageOptions, { offer, className: "w-40" }) : display.unlimitedMileage ? "Unlimited" : /* @__PURE__ */ jsxs77("span", { className: "fb-tabular", children: [
|
|
11067
11074
|
display.kmPerDay,
|
|
11068
11075
|
" km/d"
|
|
11069
11076
|
] }),
|
|
11070
|
-
/* @__PURE__ */
|
|
11077
|
+
/* @__PURE__ */ jsx120(CoverOptions, { offer, className: "mt-1 w-40" })
|
|
11071
11078
|
] }),
|
|
11072
|
-
/* @__PURE__ */
|
|
11073
|
-
/* @__PURE__ */
|
|
11074
|
-
/* @__PURE__ */
|
|
11075
|
-
/* @__PURE__ */
|
|
11076
|
-
/* @__PURE__ */
|
|
11079
|
+
/* @__PURE__ */ jsx120("td", { className: "fb-tabular px-3 py-2.5 text-right text-car-muted", children: display.deposit > 0 ? formatZAR(display.deposit) : "\u2013" }),
|
|
11080
|
+
/* @__PURE__ */ jsx120("td", { className: "px-3 py-2.5 text-right", children: /* @__PURE__ */ jsx120(DailyPrice, { offer, size: "sm", className: "justify-end" }) }),
|
|
11081
|
+
/* @__PURE__ */ jsx120("td", { className: "fb-tabular px-3 py-2.5 text-right font-semibold text-car-price", children: display.totalRate > 0 ? formatZAR(display.totalRate) : "\u2013" }),
|
|
11082
|
+
/* @__PURE__ */ jsx120("td", { className: "px-3 py-2.5", children: /* @__PURE__ */ jsxs77("div", { className: "flex flex-col items-stretch gap-1", children: [
|
|
11083
|
+
/* @__PURE__ */ jsxs77(
|
|
11077
11084
|
"button",
|
|
11078
11085
|
{
|
|
11079
11086
|
type: "button",
|
|
@@ -11081,18 +11088,18 @@ function TableRow({ car, priority, cheapest, bookLabel, ...options }) {
|
|
|
11081
11088
|
className: "fb-focus inline-flex h-8 items-center justify-center gap-1 rounded-lg bg-car-cta px-3 text-[0.6875rem] font-semibold tracking-[0.06em] whitespace-nowrap text-car-cta-fg uppercase transition-colors hover:bg-car-cta/90",
|
|
11082
11089
|
children: [
|
|
11083
11090
|
bookLabel ?? "Book",
|
|
11084
|
-
/* @__PURE__ */
|
|
11091
|
+
/* @__PURE__ */ jsx120(ArrowRight7, { className: "size-3.5", "aria-hidden": "true" })
|
|
11085
11092
|
]
|
|
11086
11093
|
}
|
|
11087
11094
|
),
|
|
11088
|
-
offer.onQuoteClick && /* @__PURE__ */
|
|
11095
|
+
offer.onQuoteClick && /* @__PURE__ */ jsxs77(
|
|
11089
11096
|
"button",
|
|
11090
11097
|
{
|
|
11091
11098
|
type: "button",
|
|
11092
11099
|
onClick: offer.onQuoteClick,
|
|
11093
11100
|
className: "fb-focus inline-flex h-7 items-center justify-center gap-1 rounded-lg px-2 text-[0.6875rem] whitespace-nowrap text-car-muted hover:bg-car-photo hover:text-car-title",
|
|
11094
11101
|
children: [
|
|
11095
|
-
/* @__PURE__ */
|
|
11102
|
+
/* @__PURE__ */ jsx120(MessageSquareQuote3, { className: "size-3.5 opacity-70", "aria-hidden": "true" }),
|
|
11096
11103
|
"Quote"
|
|
11097
11104
|
]
|
|
11098
11105
|
}
|
|
@@ -11102,7 +11109,7 @@ function TableRow({ car, priority, cheapest, bookLabel, ...options }) {
|
|
|
11102
11109
|
}
|
|
11103
11110
|
|
|
11104
11111
|
// src/components/CarList/CarListSkeleton.tsx
|
|
11105
|
-
import { jsx as
|
|
11112
|
+
import { jsx as jsx121, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
11106
11113
|
var BOX2 = "rounded-2xl border border-car-border bg-car-bg shadow-car";
|
|
11107
11114
|
function CarListSkeleton({
|
|
11108
11115
|
count: count2 = 6,
|
|
@@ -11111,55 +11118,55 @@ function CarListSkeleton({
|
|
|
11111
11118
|
}) {
|
|
11112
11119
|
const items = Array.from({ length: count2 });
|
|
11113
11120
|
if (listStyle === "rows") {
|
|
11114
|
-
return /* @__PURE__ */
|
|
11115
|
-
/* @__PURE__ */
|
|
11116
|
-
/* @__PURE__ */
|
|
11117
|
-
/* @__PURE__ */
|
|
11118
|
-
/* @__PURE__ */
|
|
11119
|
-
/* @__PURE__ */
|
|
11120
|
-
/* @__PURE__ */
|
|
11121
|
+
return /* @__PURE__ */ jsx121("div", { className: cn("grid gap-3", className), role: "status", "aria-label": "Loading cars", children: items.slice(0, 4).map((_, index) => /* @__PURE__ */ jsxs78("div", { "aria-hidden": "true", className: cn(BOX2, "flex gap-4 p-3"), children: [
|
|
11122
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton aspect-[16/11] w-40 shrink-0 rounded-lg" }),
|
|
11123
|
+
/* @__PURE__ */ jsxs78("div", { className: "grid flex-1 content-start gap-2 py-1", children: [
|
|
11124
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-3 w-16 rounded-sm" }),
|
|
11125
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-4 w-1/2 rounded-sm" }),
|
|
11126
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-3 w-1/3 rounded-sm" }),
|
|
11127
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton mt-2 h-3 w-2/3 rounded-sm" })
|
|
11121
11128
|
] }),
|
|
11122
|
-
/* @__PURE__ */
|
|
11123
|
-
/* @__PURE__ */
|
|
11124
|
-
/* @__PURE__ */
|
|
11129
|
+
/* @__PURE__ */ jsxs78("div", { className: "hidden w-40 shrink-0 content-center gap-2 sm:grid", children: [
|
|
11130
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-5 w-24 rounded-sm" }),
|
|
11131
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-9 w-full rounded-lg" })
|
|
11125
11132
|
] })
|
|
11126
11133
|
] }, index)) });
|
|
11127
11134
|
}
|
|
11128
11135
|
if (listStyle === "table") {
|
|
11129
|
-
return /* @__PURE__ */
|
|
11130
|
-
/* @__PURE__ */
|
|
11131
|
-
items.map((_, index) => /* @__PURE__ */
|
|
11132
|
-
/* @__PURE__ */
|
|
11133
|
-
/* @__PURE__ */
|
|
11134
|
-
/* @__PURE__ */
|
|
11135
|
-
/* @__PURE__ */
|
|
11136
|
+
return /* @__PURE__ */ jsxs78("div", { className: cn(BOX2, "overflow-hidden", className), role: "status", "aria-label": "Loading cars", children: [
|
|
11137
|
+
/* @__PURE__ */ jsx121("div", { className: "h-9 bg-car-photo", "aria-hidden": "true" }),
|
|
11138
|
+
items.map((_, index) => /* @__PURE__ */ jsxs78("div", { "aria-hidden": "true", className: "flex items-center gap-3 border-t border-car-border px-3 py-2.5", children: [
|
|
11139
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton aspect-[4/3] w-20 shrink-0 rounded-md" }),
|
|
11140
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-3.5 w-40 rounded-sm" }),
|
|
11141
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton ml-auto h-3.5 w-20 rounded-sm" }),
|
|
11142
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-8 w-16 rounded-lg" })
|
|
11136
11143
|
] }, index))
|
|
11137
11144
|
] });
|
|
11138
11145
|
}
|
|
11139
11146
|
if (listStyle === "showcase") {
|
|
11140
|
-
return /* @__PURE__ */
|
|
11141
|
-
/* @__PURE__ */
|
|
11142
|
-
/* @__PURE__ */
|
|
11143
|
-
/* @__PURE__ */
|
|
11144
|
-
/* @__PURE__ */
|
|
11147
|
+
return /* @__PURE__ */ jsx121("div", { className: cn("@container/list", className), role: "status", "aria-label": "Loading cars", children: /* @__PURE__ */ jsx121("div", { className: "grid gap-4 @2xl/list:grid-cols-2", children: items.slice(0, 4).map((_, index) => /* @__PURE__ */ jsxs78("div", { "aria-hidden": "true", className: cn(BOX2, "overflow-hidden rounded-3xl"), children: [
|
|
11148
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton aspect-[16/9]" }),
|
|
11149
|
+
/* @__PURE__ */ jsxs78("div", { className: "grid gap-2 p-5", children: [
|
|
11150
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-5 w-1/2 rounded-sm" }),
|
|
11151
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-3 w-1/4 rounded-sm" })
|
|
11145
11152
|
] })
|
|
11146
11153
|
] }, index)) }) });
|
|
11147
11154
|
}
|
|
11148
11155
|
if (listStyle === "grouped") {
|
|
11149
|
-
return /* @__PURE__ */
|
|
11150
|
-
/* @__PURE__ */
|
|
11151
|
-
/* @__PURE__ */
|
|
11152
|
-
/* @__PURE__ */
|
|
11153
|
-
/* @__PURE__ */
|
|
11154
|
-
/* @__PURE__ */
|
|
11156
|
+
return /* @__PURE__ */ jsx121("div", { className: cn("grid gap-6", className), role: "status", "aria-label": "Loading cars", children: [0, 1].map((group) => /* @__PURE__ */ jsxs78("div", { "aria-hidden": "true", children: [
|
|
11157
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton mb-2.5 h-4 w-40 rounded-sm" }),
|
|
11158
|
+
/* @__PURE__ */ jsx121("div", { className: "flex gap-3 overflow-hidden", children: [0, 1, 2].map((index) => /* @__PURE__ */ jsxs78("div", { className: cn(BOX2, "grid w-[15.5rem] shrink-0 gap-2 p-3"), children: [
|
|
11159
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton aspect-[16/9] rounded-lg" }),
|
|
11160
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-4 w-2/3 rounded-sm" }),
|
|
11161
|
+
/* @__PURE__ */ jsx121("div", { className: "fb-skeleton h-9 w-full rounded-lg" })
|
|
11155
11162
|
] }, index)) })
|
|
11156
11163
|
] }, group)) });
|
|
11157
11164
|
}
|
|
11158
|
-
return /* @__PURE__ */
|
|
11165
|
+
return /* @__PURE__ */ jsx121("div", { className: cn(GRID_CLASSES, className), role: "status", "aria-label": "Loading cars", children: items.map((_, index) => /* @__PURE__ */ jsx121("div", { className: "@container flex", children: /* @__PURE__ */ jsx121(CarCardSkeleton, {}) }, index)) });
|
|
11159
11166
|
}
|
|
11160
11167
|
|
|
11161
11168
|
// src/components/CarList/index.tsx
|
|
11162
|
-
import { jsx as
|
|
11169
|
+
import { jsx as jsx122, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
11163
11170
|
function CarList({
|
|
11164
11171
|
cars,
|
|
11165
11172
|
listStyle = DEFAULT_LIST_STYLE,
|
|
@@ -11191,18 +11198,18 @@ function CarList({
|
|
|
11191
11198
|
listRef
|
|
11192
11199
|
);
|
|
11193
11200
|
if (!cars.length && emptyLayout === "inline") {
|
|
11194
|
-
return /* @__PURE__ */
|
|
11195
|
-
/* @__PURE__ */
|
|
11196
|
-
/* @__PURE__ */
|
|
11197
|
-
/* @__PURE__ */
|
|
11198
|
-
onReset && /* @__PURE__ */
|
|
11199
|
-
/* @__PURE__ */
|
|
11201
|
+
return /* @__PURE__ */ jsxs79("div", { role: "status", className: cn("flex flex-col items-center px-4 py-14 text-center sm:py-20", className), children: [
|
|
11202
|
+
/* @__PURE__ */ jsx122("span", { className: "grid size-12 place-items-center rounded-full bg-surface-2 text-muted-foreground", children: /* @__PURE__ */ jsx122(SearchX, { className: "size-5", "aria-hidden": "true" }) }),
|
|
11203
|
+
/* @__PURE__ */ jsx122("h3", { className: "mt-4 max-w-[460px] text-[1.125rem] leading-snug font-semibold tracking-[-0.01em] text-foreground sm:text-[1.25rem]", children: "No cars match those filters" }),
|
|
11204
|
+
/* @__PURE__ */ jsx122("p", { className: "mt-2 max-w-[460px] text-[0.875rem] leading-relaxed text-muted-foreground", children: emptyDescription }),
|
|
11205
|
+
onReset && /* @__PURE__ */ jsxs79(CtaButton, { type: "button", onClick: onReset, className: "mt-6", children: [
|
|
11206
|
+
/* @__PURE__ */ jsx122(RotateCcw, { className: "size-4", "aria-hidden": "true" }),
|
|
11200
11207
|
emptyActionLabel
|
|
11201
11208
|
] })
|
|
11202
11209
|
] });
|
|
11203
11210
|
}
|
|
11204
11211
|
if (!cars.length) {
|
|
11205
|
-
return /* @__PURE__ */
|
|
11212
|
+
return /* @__PURE__ */ jsxs79(
|
|
11206
11213
|
"div",
|
|
11207
11214
|
{
|
|
11208
11215
|
className: cn(
|
|
@@ -11210,11 +11217,11 @@ function CarList({
|
|
|
11210
11217
|
className
|
|
11211
11218
|
),
|
|
11212
11219
|
children: [
|
|
11213
|
-
/* @__PURE__ */
|
|
11214
|
-
/* @__PURE__ */
|
|
11215
|
-
/* @__PURE__ */
|
|
11216
|
-
onReset && /* @__PURE__ */
|
|
11217
|
-
/* @__PURE__ */
|
|
11220
|
+
/* @__PURE__ */ jsx122("span", { className: "grid size-14 place-items-center rounded-full bg-surface-2 ring-8 ring-surface-2/50", children: /* @__PURE__ */ jsx122(SearchX, { className: "size-6 text-muted-foreground", "aria-hidden": "true" }) }),
|
|
11221
|
+
/* @__PURE__ */ jsx122("h3", { className: "mt-5 text-lg font-semibold tracking-[-0.01em] text-foreground", children: "No cars match that" }),
|
|
11222
|
+
/* @__PURE__ */ jsx122("p", { className: "mt-2 max-w-sm text-[0.875rem] leading-relaxed text-muted-foreground", children: emptyDescription }),
|
|
11223
|
+
onReset && /* @__PURE__ */ jsxs79(CtaButton, { type: "button", onClick: onReset, className: "mt-6", children: [
|
|
11224
|
+
/* @__PURE__ */ jsx122(RotateCcw, { className: "size-4", "aria-hidden": "true" }),
|
|
11218
11225
|
emptyActionLabel
|
|
11219
11226
|
] })
|
|
11220
11227
|
]
|
|
@@ -11222,11 +11229,11 @@ function CarList({
|
|
|
11222
11229
|
);
|
|
11223
11230
|
}
|
|
11224
11231
|
const item = { bookingUrl, onBook, onQuote, rentalDays: rentalDays2, bookLabel };
|
|
11225
|
-
return /* @__PURE__ */
|
|
11232
|
+
return /* @__PURE__ */ jsx122("div", { ref: listRef, className: cn("@container/list", className), children: listStyle === "rows" ? /* @__PURE__ */ jsx122(RowsStyle, { cars, ...item }) : listStyle === "table" ? /* @__PURE__ */ jsx122(TableStyle, { cars, ...item }) : listStyle === "showcase" ? /* @__PURE__ */ jsx122(ShowcaseStyle, { cars, ...item }) : listStyle === "grouped" ? /* @__PURE__ */ jsx122(GroupedStyle, { cars, ...item }) : /* @__PURE__ */ jsx122("div", { className: GRID_CLASSES, children: cars.map((car, index) => (
|
|
11226
11233
|
// `@container` lives here rather than on the card: container-type
|
|
11227
11234
|
// applies to descendants, so a card that declared it could not query
|
|
11228
11235
|
// its own width. This wrapper is the same width as the card.
|
|
11229
|
-
/* @__PURE__ */
|
|
11236
|
+
/* @__PURE__ */ jsx122("div", { "data-car-card": true, className: "@container fb-hidden flex", children: /* @__PURE__ */ jsx122(
|
|
11230
11237
|
CarCard,
|
|
11231
11238
|
{
|
|
11232
11239
|
car,
|
|
@@ -11244,7 +11251,7 @@ function CarList({
|
|
|
11244
11251
|
|
|
11245
11252
|
// src/components/ResultsPage/SourceChips.tsx
|
|
11246
11253
|
import { Check as Check9, LoaderCircle as LoaderCircle4 } from "lucide-react";
|
|
11247
|
-
import { jsx as
|
|
11254
|
+
import { jsx as jsx123, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
11248
11255
|
var OWN_FLEET = "own-fleet";
|
|
11249
11256
|
var HIDDEN = /* @__PURE__ */ new Set(["notConnected", "noCodes"]);
|
|
11250
11257
|
function SourceChips({ sources }) {
|
|
@@ -11252,11 +11259,11 @@ function SourceChips({ sources }) {
|
|
|
11252
11259
|
if (shown.length < 2) return null;
|
|
11253
11260
|
const searching = shown.some((source) => source.pending);
|
|
11254
11261
|
const sorted = searching ? shown : [...shown].sort((a, b) => Number(hasCars(b)) - Number(hasCars(a)) || nameOf(a).localeCompare(nameOf(b)));
|
|
11255
|
-
return /* @__PURE__ */
|
|
11262
|
+
return /* @__PURE__ */ jsx123("ul", { className: "mt-4 flex flex-wrap items-center gap-2", "aria-label": "Suppliers searched", "aria-busy": searching, children: sorted.map((source) => {
|
|
11256
11263
|
const found = hasCars(source);
|
|
11257
11264
|
const name = nameOf(source);
|
|
11258
11265
|
const reason = source.pending ? "Searching\u2026" : found ? `${source.count} ${source.count === 1 ? "car" : "cars"}` : source.customerMessage ?? "No cars to show";
|
|
11259
|
-
return /* @__PURE__ */
|
|
11266
|
+
return /* @__PURE__ */ jsxs80(
|
|
11260
11267
|
"li",
|
|
11261
11268
|
{
|
|
11262
11269
|
title: reason,
|
|
@@ -11265,10 +11272,10 @@ function SourceChips({ sources }) {
|
|
|
11265
11272
|
found ? "border border-listing-border bg-white pl-1.5 text-listing-text" : source.pending ? "border border-listing-border bg-white pl-1.5 text-listing-muted" : "border border-transparent bg-listing-chip pl-4 text-listing-muted opacity-70"
|
|
11266
11273
|
),
|
|
11267
11274
|
children: [
|
|
11268
|
-
source.pending && /* @__PURE__ */
|
|
11269
|
-
found && /* @__PURE__ */
|
|
11275
|
+
source.pending && /* @__PURE__ */ jsx123("span", { className: "grid size-6 place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx123(LoaderCircle4, { className: "size-4 animate-spin motion-reduce:animate-none" }) }),
|
|
11276
|
+
found && /* @__PURE__ */ jsx123("span", { className: "grid size-6 place-items-center rounded-full bg-emerald-700 text-white", "aria-hidden": "true", children: /* @__PURE__ */ jsx123(Check9, { className: "size-3.5", strokeWidth: 3 }) }),
|
|
11270
11277
|
name,
|
|
11271
|
-
/* @__PURE__ */
|
|
11278
|
+
/* @__PURE__ */ jsxs80("span", { className: "sr-only", children: [
|
|
11272
11279
|
": ",
|
|
11273
11280
|
reason
|
|
11274
11281
|
] })
|
|
@@ -11290,15 +11297,15 @@ import { useEffect as useEffect17, useRef as useRef11 } from "react";
|
|
|
11290
11297
|
import { RotateCcw as RotateCcw3, SlidersHorizontal } from "lucide-react";
|
|
11291
11298
|
|
|
11292
11299
|
// src/components/FilterPanel/FilterBlock.tsx
|
|
11293
|
-
import { jsx as
|
|
11300
|
+
import { jsx as jsx124, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
11294
11301
|
function FilterBlock({
|
|
11295
11302
|
title,
|
|
11296
11303
|
icon: Icon,
|
|
11297
11304
|
children
|
|
11298
11305
|
}) {
|
|
11299
|
-
return /* @__PURE__ */
|
|
11300
|
-
/* @__PURE__ */
|
|
11301
|
-
Icon && /* @__PURE__ */
|
|
11306
|
+
return /* @__PURE__ */ jsxs81("section", { "data-filter-block": true, className: "fb-hidden border-t border-listing-border pt-5", children: [
|
|
11307
|
+
/* @__PURE__ */ jsxs81("h3", { className: "mb-3 flex items-center gap-2 text-[0.875rem] font-semibold text-filter-title", children: [
|
|
11308
|
+
Icon && /* @__PURE__ */ jsx124(Icon, { className: "size-4 text-filter-muted", "aria-hidden": "true", strokeWidth: 1.75 }),
|
|
11302
11309
|
title
|
|
11303
11310
|
] }),
|
|
11304
11311
|
children
|
|
@@ -11310,20 +11317,20 @@ import { useMemo as useMemo12 } from "react";
|
|
|
11310
11317
|
import { Briefcase as Briefcase5, Cog as Cog5, Fuel as Fuel3, Gauge as Gauge5, LayoutGrid, Store, Users as Users6, Wallet as Wallet2 } from "lucide-react";
|
|
11311
11318
|
|
|
11312
11319
|
// src/components/FilterPanel/ScrollRow.tsx
|
|
11313
|
-
import { jsx as
|
|
11320
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
11314
11321
|
function ScrollRow({ children }) {
|
|
11315
|
-
return /* @__PURE__ */
|
|
11322
|
+
return /* @__PURE__ */ jsx125("div", { className: "flex flex-wrap gap-1.5", children });
|
|
11316
11323
|
}
|
|
11317
11324
|
|
|
11318
11325
|
// src/components/FilterPanel/Pill.tsx
|
|
11319
11326
|
import { Check as Check10 } from "lucide-react";
|
|
11320
|
-
import { jsx as
|
|
11327
|
+
import { jsx as jsx126, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
11321
11328
|
function Pill({
|
|
11322
11329
|
label: label2,
|
|
11323
11330
|
active,
|
|
11324
11331
|
onClick
|
|
11325
11332
|
}) {
|
|
11326
|
-
return /* @__PURE__ */
|
|
11333
|
+
return /* @__PURE__ */ jsxs82(
|
|
11327
11334
|
"button",
|
|
11328
11335
|
{
|
|
11329
11336
|
type: "button",
|
|
@@ -11335,7 +11342,7 @@ function Pill({
|
|
|
11335
11342
|
active ? "bg-filter-pill-active text-filter-pill-active-fg shadow-sm" : "bg-filter-pill text-filter-pill-fg hover:text-filter-title hover:ring-1 hover:ring-filter-title/20"
|
|
11336
11343
|
),
|
|
11337
11344
|
children: [
|
|
11338
|
-
active && /* @__PURE__ */
|
|
11345
|
+
active && /* @__PURE__ */ jsx126(Check10, { className: "size-3", strokeWidth: 2.5, "aria-hidden": "true" }),
|
|
11339
11346
|
label2
|
|
11340
11347
|
]
|
|
11341
11348
|
}
|
|
@@ -11343,7 +11350,7 @@ function Pill({
|
|
|
11343
11350
|
}
|
|
11344
11351
|
|
|
11345
11352
|
// src/components/FilterPanel/FilterControls.tsx
|
|
11346
|
-
import { Fragment as Fragment14, jsx as
|
|
11353
|
+
import { Fragment as Fragment14, jsx as jsx127, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
11347
11354
|
function isBodyCategory(value) {
|
|
11348
11355
|
const trimmed = value.trim();
|
|
11349
11356
|
if (!trimmed || /^[A-Z]{1,3}\d?$/i.test(trimmed)) return false;
|
|
@@ -11374,7 +11381,7 @@ var FILTER_SECTIONS = [
|
|
|
11374
11381
|
icon: Wallet2,
|
|
11375
11382
|
active: (filters, bounds) => filters.priceRange[0] > bounds[0] || filters.priceRange[1] < bounds[1],
|
|
11376
11383
|
shown: () => true,
|
|
11377
|
-
render: (props) => /* @__PURE__ */
|
|
11384
|
+
render: (props) => /* @__PURE__ */ jsx127(PriceControl, { ...props })
|
|
11378
11385
|
},
|
|
11379
11386
|
{
|
|
11380
11387
|
id: "transmission",
|
|
@@ -11382,7 +11389,7 @@ var FILTER_SECTIONS = [
|
|
|
11382
11389
|
icon: Cog5,
|
|
11383
11390
|
active: (filters) => filters.transmission !== "any",
|
|
11384
11391
|
shown: (options) => options.hasTransmission,
|
|
11385
|
-
render: ({ filters, onChange }) => /* @__PURE__ */
|
|
11392
|
+
render: ({ filters, onChange }) => /* @__PURE__ */ jsx127(
|
|
11386
11393
|
PillGroup,
|
|
11387
11394
|
{
|
|
11388
11395
|
value: filters.transmission,
|
|
@@ -11397,7 +11404,7 @@ var FILTER_SECTIONS = [
|
|
|
11397
11404
|
icon: Store,
|
|
11398
11405
|
active: (filters) => filters.suppliers.length > 0,
|
|
11399
11406
|
shown: (options) => options.suppliers.length > 0,
|
|
11400
|
-
render: ({ filters, onToggle, options }) => /* @__PURE__ */
|
|
11407
|
+
render: ({ filters, onToggle, options }) => /* @__PURE__ */ jsx127(ScrollRow, { children: options.suppliers.map((supplier) => /* @__PURE__ */ jsx127(
|
|
11401
11408
|
Pill,
|
|
11402
11409
|
{
|
|
11403
11410
|
active: filters.suppliers.includes(supplier),
|
|
@@ -11413,7 +11420,7 @@ var FILTER_SECTIONS = [
|
|
|
11413
11420
|
icon: LayoutGrid,
|
|
11414
11421
|
active: (filters) => filters.categories.length > 0,
|
|
11415
11422
|
shown: (options) => options.bodyCategories.length > 0,
|
|
11416
|
-
render: ({ filters, onToggle, options }) => /* @__PURE__ */
|
|
11423
|
+
render: ({ filters, onToggle, options }) => /* @__PURE__ */ jsx127(ScrollRow, { children: options.bodyCategories.map((category) => /* @__PURE__ */ jsx127(
|
|
11417
11424
|
Pill,
|
|
11418
11425
|
{
|
|
11419
11426
|
active: filters.categories.includes(category),
|
|
@@ -11429,11 +11436,11 @@ var FILTER_SECTIONS = [
|
|
|
11429
11436
|
icon: Fuel3,
|
|
11430
11437
|
active: (filters) => filters.fuels.length > 0,
|
|
11431
11438
|
shown: (options) => options.hasFuel,
|
|
11432
|
-
render: ({ cars, filters, onToggle }) => /* @__PURE__ */
|
|
11439
|
+
render: ({ cars, filters, onToggle }) => /* @__PURE__ */ jsx127(ScrollRow, { children: FUEL_TYPES.map((fuel) => {
|
|
11433
11440
|
const active = filters.fuels.includes(fuel);
|
|
11434
11441
|
const present = cars.some((car) => car.fuelType === fuel);
|
|
11435
11442
|
if (!present && !active) return null;
|
|
11436
|
-
return /* @__PURE__ */
|
|
11443
|
+
return /* @__PURE__ */ jsx127(Pill, { active, onClick: () => onToggle("fuels", fuel), label: fuel }, fuel);
|
|
11437
11444
|
}) })
|
|
11438
11445
|
},
|
|
11439
11446
|
{
|
|
@@ -11443,7 +11450,7 @@ var FILTER_SECTIONS = [
|
|
|
11443
11450
|
icon: Gauge5,
|
|
11444
11451
|
active: (filters) => filters.mileage !== null,
|
|
11445
11452
|
shown: (options) => options.mileageOptions.length > 1,
|
|
11446
|
-
render: ({ filters, onChange, options }) => /* @__PURE__ */
|
|
11453
|
+
render: ({ filters, onChange, options }) => /* @__PURE__ */ jsx127(
|
|
11447
11454
|
PillGroup,
|
|
11448
11455
|
{
|
|
11449
11456
|
value: filters.mileage,
|
|
@@ -11458,7 +11465,7 @@ var FILTER_SECTIONS = [
|
|
|
11458
11465
|
icon: Users6,
|
|
11459
11466
|
active: (filters) => filters.seats !== null,
|
|
11460
11467
|
shown: () => true,
|
|
11461
|
-
render: ({ filters, onChange, options }) => /* @__PURE__ */
|
|
11468
|
+
render: ({ filters, onChange, options }) => /* @__PURE__ */ jsx127(
|
|
11462
11469
|
PillGroup,
|
|
11463
11470
|
{
|
|
11464
11471
|
value: filters.seats,
|
|
@@ -11473,7 +11480,7 @@ var FILTER_SECTIONS = [
|
|
|
11473
11480
|
icon: Briefcase5,
|
|
11474
11481
|
active: (filters) => filters.luggage !== null,
|
|
11475
11482
|
shown: (options) => options.hasLuggage,
|
|
11476
|
-
render: ({ filters, onChange, options }) => /* @__PURE__ */
|
|
11483
|
+
render: ({ filters, onChange, options }) => /* @__PURE__ */ jsx127(
|
|
11477
11484
|
PillGroup,
|
|
11478
11485
|
{
|
|
11479
11486
|
value: filters.luggage,
|
|
@@ -11489,15 +11496,15 @@ function PriceControl({
|
|
|
11489
11496
|
onChange,
|
|
11490
11497
|
options
|
|
11491
11498
|
}) {
|
|
11492
|
-
return /* @__PURE__ */
|
|
11493
|
-
/* @__PURE__ */
|
|
11494
|
-
/* @__PURE__ */
|
|
11495
|
-
/* @__PURE__ */
|
|
11499
|
+
return /* @__PURE__ */ jsxs83(Fragment14, { children: [
|
|
11500
|
+
/* @__PURE__ */ jsx127("div", { className: "mb-3 grid grid-cols-2 gap-2", children: ["From", "To"].map((label2, index) => /* @__PURE__ */ jsxs83("div", { className: "rounded-lg border border-listing-border px-2.5 py-1.5", children: [
|
|
11501
|
+
/* @__PURE__ */ jsx127("p", { className: "text-[0.625rem] font-semibold tracking-[0.08em] text-filter-muted uppercase", children: label2 }),
|
|
11502
|
+
/* @__PURE__ */ jsx127("p", { className: "fb-tabular text-[0.8125rem] font-semibold text-filter-title", children: formatZAR(filters.priceRange[index]) })
|
|
11496
11503
|
] }, label2)) }),
|
|
11497
|
-
/* @__PURE__ */
|
|
11504
|
+
/* @__PURE__ */ jsx127("div", { className: "mb-3 flex h-10 items-end gap-0.5", "aria-hidden": "true", children: options.histogram.map((height, index) => {
|
|
11498
11505
|
const bucketPrice = priceBounds[0] + (priceBounds[1] - priceBounds[0]) * index / options.histogram.length;
|
|
11499
11506
|
const inRange = bucketPrice >= filters.priceRange[0] && bucketPrice <= filters.priceRange[1];
|
|
11500
|
-
return /* @__PURE__ */
|
|
11507
|
+
return /* @__PURE__ */ jsx127(
|
|
11501
11508
|
"span",
|
|
11502
11509
|
{
|
|
11503
11510
|
style: { height: `${Math.max(8, height * 100)}%` },
|
|
@@ -11509,7 +11516,7 @@ function PriceControl({
|
|
|
11509
11516
|
index
|
|
11510
11517
|
);
|
|
11511
11518
|
}) }),
|
|
11512
|
-
/* @__PURE__ */
|
|
11519
|
+
/* @__PURE__ */ jsx127(
|
|
11513
11520
|
Slider,
|
|
11514
11521
|
{
|
|
11515
11522
|
value: filters.priceRange,
|
|
@@ -11526,8 +11533,8 @@ function PriceControl({
|
|
|
11526
11533
|
|
|
11527
11534
|
// src/components/FilterPanel/FilterLooks.tsx
|
|
11528
11535
|
import { useMemo as useMemo13 } from "react";
|
|
11529
|
-
import { CarFront, ChevronDown as
|
|
11530
|
-
import { Fragment as Fragment15, jsx as
|
|
11536
|
+
import { CarFront, ChevronDown as ChevronDown2, RotateCcw as RotateCcw2 } from "lucide-react";
|
|
11537
|
+
import { Fragment as Fragment15, jsx as jsx128, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
11531
11538
|
var Z_ABOVE_HOST_THEME = "z-2147483000";
|
|
11532
11539
|
function clearSection(id, priceBounds) {
|
|
11533
11540
|
switch (id) {
|
|
@@ -11557,7 +11564,7 @@ function FilterChipBar({
|
|
|
11557
11564
|
}) {
|
|
11558
11565
|
const options = useFilterOptions(props.cars, props.priceBounds);
|
|
11559
11566
|
const sections = FILTER_SECTIONS.filter((section) => section.shown(options));
|
|
11560
|
-
return /* @__PURE__ */
|
|
11567
|
+
return /* @__PURE__ */ jsxs84(
|
|
11561
11568
|
"div",
|
|
11562
11569
|
{
|
|
11563
11570
|
role: "group",
|
|
@@ -11570,8 +11577,8 @@ function FilterChipBar({
|
|
|
11570
11577
|
sections.map((section) => {
|
|
11571
11578
|
const Icon = section.icon;
|
|
11572
11579
|
const active = section.active(props.filters, props.priceBounds);
|
|
11573
|
-
return /* @__PURE__ */
|
|
11574
|
-
/* @__PURE__ */
|
|
11580
|
+
return /* @__PURE__ */ jsxs84(Popover, { children: [
|
|
11581
|
+
/* @__PURE__ */ jsx128(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs84(
|
|
11575
11582
|
"button",
|
|
11576
11583
|
{
|
|
11577
11584
|
type: "button",
|
|
@@ -11581,17 +11588,17 @@ function FilterChipBar({
|
|
|
11581
11588
|
active ? "bg-filter-pill-active text-filter-pill-active-fg shadow-sm" : "bg-filter-pill text-filter-pill-fg hover:text-filter-title"
|
|
11582
11589
|
),
|
|
11583
11590
|
children: [
|
|
11584
|
-
/* @__PURE__ */
|
|
11591
|
+
/* @__PURE__ */ jsx128(Icon, { className: "size-3.5", "aria-hidden": "true" }),
|
|
11585
11592
|
section.title,
|
|
11586
|
-
active && /* @__PURE__ */
|
|
11587
|
-
/* @__PURE__ */
|
|
11593
|
+
active && /* @__PURE__ */ jsx128("span", { className: "size-1.5 rounded-full bg-current", "aria-label": "(in use)" }),
|
|
11594
|
+
/* @__PURE__ */ jsx128(ChevronDown2, { className: "size-3.5 opacity-60", "aria-hidden": "true" })
|
|
11588
11595
|
]
|
|
11589
11596
|
}
|
|
11590
11597
|
) }),
|
|
11591
|
-
/* @__PURE__ */
|
|
11592
|
-
/* @__PURE__ */
|
|
11593
|
-
/* @__PURE__ */
|
|
11594
|
-
active && /* @__PURE__ */
|
|
11598
|
+
/* @__PURE__ */ jsxs84(PopoverContent, { align: "start", sideOffset: 8, className: cn(Z_ABOVE_HOST_THEME, "w-80 gap-3 rounded-2xl p-4 shadow-xl"), children: [
|
|
11599
|
+
/* @__PURE__ */ jsxs84("div", { className: "flex items-center justify-between gap-2", children: [
|
|
11600
|
+
/* @__PURE__ */ jsx128("p", { className: "text-[0.875rem] font-semibold text-filter-title", children: section.title }),
|
|
11601
|
+
active && /* @__PURE__ */ jsx128(
|
|
11595
11602
|
"button",
|
|
11596
11603
|
{
|
|
11597
11604
|
type: "button",
|
|
@@ -11605,16 +11612,16 @@ function FilterChipBar({
|
|
|
11605
11612
|
] })
|
|
11606
11613
|
] }, section.id);
|
|
11607
11614
|
}),
|
|
11608
|
-
activeCount > 0 && /* @__PURE__ */
|
|
11609
|
-
/* @__PURE__ */
|
|
11610
|
-
/* @__PURE__ */
|
|
11615
|
+
activeCount > 0 && /* @__PURE__ */ jsxs84(Fragment15, { children: [
|
|
11616
|
+
/* @__PURE__ */ jsx128("span", { className: "mx-1 h-6 w-px shrink-0 bg-listing-border", "aria-hidden": "true" }),
|
|
11617
|
+
/* @__PURE__ */ jsxs84(
|
|
11611
11618
|
"button",
|
|
11612
11619
|
{
|
|
11613
11620
|
type: "button",
|
|
11614
11621
|
onClick: onReset,
|
|
11615
11622
|
className: "fb-focus flex h-9 shrink-0 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] font-semibold text-filter-title hover:bg-filter-pill",
|
|
11616
11623
|
children: [
|
|
11617
|
-
/* @__PURE__ */
|
|
11624
|
+
/* @__PURE__ */ jsx128(RotateCcw2, { className: "size-3.5", "aria-hidden": "true" }),
|
|
11618
11625
|
"Clear all"
|
|
11619
11626
|
]
|
|
11620
11627
|
}
|
|
@@ -11639,9 +11646,9 @@ function CarTypeTabs({ cars, filters, priceBounds, onChange, className }) {
|
|
|
11639
11646
|
}, [cars, options.bodyCategories]);
|
|
11640
11647
|
if (options.bodyCategories.length < 2) return null;
|
|
11641
11648
|
const chosen = filters.categories.length === 1 ? filters.categories[0] : filters.categories.length === 0 ? "" : null;
|
|
11642
|
-
return /* @__PURE__ */
|
|
11649
|
+
return /* @__PURE__ */ jsx128("div", { role: "group", "aria-label": "Kind of car", className: cn("flex gap-3 overflow-x-auto pb-1 [scrollbar-width:none]", className), children: tiles.map((tile) => {
|
|
11643
11650
|
const on = chosen === tile.key;
|
|
11644
|
-
return /* @__PURE__ */
|
|
11651
|
+
return /* @__PURE__ */ jsxs84(
|
|
11645
11652
|
"button",
|
|
11646
11653
|
{
|
|
11647
11654
|
type: "button",
|
|
@@ -11653,7 +11660,7 @@ function CarTypeTabs({ cars, filters, priceBounds, onChange, className }) {
|
|
|
11653
11660
|
on ? "bg-wizard-selected text-wizard-selected-fg shadow-lg" : "bg-listing-sidebar text-listing-text shadow-panel"
|
|
11654
11661
|
),
|
|
11655
11662
|
children: [
|
|
11656
|
-
/* @__PURE__ */
|
|
11663
|
+
/* @__PURE__ */ jsx128(
|
|
11657
11664
|
"span",
|
|
11658
11665
|
{
|
|
11659
11666
|
className: cn(
|
|
@@ -11663,16 +11670,16 @@ function CarTypeTabs({ cars, filters, priceBounds, onChange, className }) {
|
|
|
11663
11670
|
children: tile.cars.length
|
|
11664
11671
|
}
|
|
11665
11672
|
),
|
|
11666
|
-
/* @__PURE__ */
|
|
11673
|
+
/* @__PURE__ */ jsx128("span", { className: "mt-4 mb-2 grid h-16 place-items-center", children: tile.car?.image ? /* @__PURE__ */ jsx128(
|
|
11667
11674
|
"img",
|
|
11668
11675
|
{
|
|
11669
11676
|
src: tile.car.image,
|
|
11670
11677
|
alt: "",
|
|
11671
11678
|
className: "fb-photo max-h-full w-full object-contain transition-transform duration-300 group-hover:scale-105"
|
|
11672
11679
|
}
|
|
11673
|
-
) : /* @__PURE__ */
|
|
11674
|
-
/* @__PURE__ */
|
|
11675
|
-
tile.car && /* @__PURE__ */
|
|
11680
|
+
) : /* @__PURE__ */ jsx128(CarFront, { className: "size-8 opacity-50", strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
11681
|
+
/* @__PURE__ */ jsx128("span", { className: "text-[0.9375rem] leading-tight font-bold", children: tile.title }),
|
|
11682
|
+
tile.car && /* @__PURE__ */ jsxs84("span", { className: cn("fb-tabular mt-0.5 text-[0.75rem]", on ? "opacity-80" : "text-listing-muted"), children: [
|
|
11676
11683
|
"from ",
|
|
11677
11684
|
formatZAR(tile.car.dailyRate),
|
|
11678
11685
|
" a day"
|
|
@@ -11685,7 +11692,7 @@ function CarTypeTabs({ cars, filters, priceBounds, onChange, className }) {
|
|
|
11685
11692
|
}
|
|
11686
11693
|
|
|
11687
11694
|
// src/components/FilterPanel/index.tsx
|
|
11688
|
-
import { jsx as
|
|
11695
|
+
import { jsx as jsx129, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
11689
11696
|
function FilterPanel({ cars, filters, priceBounds, activeCount, onChange, onToggle, onReset }) {
|
|
11690
11697
|
const options = useFilterOptions(cars, priceBounds);
|
|
11691
11698
|
const panelRef = useRef11(null);
|
|
@@ -11706,28 +11713,28 @@ function FilterPanel({ cars, filters, priceBounds, activeCount, onChange, onTogg
|
|
|
11706
11713
|
}
|
|
11707
11714
|
if (clearRef.current) pulseValue(clearRef.current);
|
|
11708
11715
|
}, [activeCount]);
|
|
11709
|
-
return /* @__PURE__ */
|
|
11710
|
-
/* @__PURE__ */
|
|
11711
|
-
/* @__PURE__ */
|
|
11712
|
-
/* @__PURE__ */
|
|
11716
|
+
return /* @__PURE__ */ jsxs85("div", { ref: panelRef, className: "flex flex-col gap-5", children: [
|
|
11717
|
+
/* @__PURE__ */ jsxs85("div", { className: "flex items-center justify-between gap-2", children: [
|
|
11718
|
+
/* @__PURE__ */ jsxs85("h2", { className: "flex items-center gap-2 text-base font-semibold tracking-[-0.01em] text-filter-title", children: [
|
|
11719
|
+
/* @__PURE__ */ jsx129(SlidersHorizontal, { className: "size-4", "aria-hidden": "true" }),
|
|
11713
11720
|
"Filters"
|
|
11714
11721
|
] }),
|
|
11715
|
-
activeCount > 0 && /* @__PURE__ */
|
|
11722
|
+
activeCount > 0 && /* @__PURE__ */ jsxs85(
|
|
11716
11723
|
"button",
|
|
11717
11724
|
{
|
|
11718
11725
|
type: "button",
|
|
11719
11726
|
onClick: onReset,
|
|
11720
11727
|
className: "fb-focus inline-flex h-8 items-center gap-1.5 rounded-full px-2.5 text-[0.75rem] font-semibold text-filter-title transition-colors hover:bg-filter-pill active:scale-95",
|
|
11721
11728
|
children: [
|
|
11722
|
-
/* @__PURE__ */
|
|
11729
|
+
/* @__PURE__ */ jsx129(RotateCcw3, { className: "size-3", "aria-hidden": "true" }),
|
|
11723
11730
|
"Clear (",
|
|
11724
|
-
/* @__PURE__ */
|
|
11731
|
+
/* @__PURE__ */ jsx129("span", { ref: clearRef, className: "fb-tabular inline-block", children: activeCount }),
|
|
11725
11732
|
")"
|
|
11726
11733
|
]
|
|
11727
11734
|
}
|
|
11728
11735
|
)
|
|
11729
11736
|
] }),
|
|
11730
|
-
FILTER_SECTIONS.filter((section) => section.shown(options)).map((section) => /* @__PURE__ */
|
|
11737
|
+
FILTER_SECTIONS.filter((section) => section.shown(options)).map((section) => /* @__PURE__ */ jsx129(FilterBlock, { title: section.title, icon: section.icon, children: section.render({ cars, filters, priceBounds, onChange, onToggle, options }) }, section.id))
|
|
11731
11738
|
] });
|
|
11732
11739
|
}
|
|
11733
11740
|
|
|
@@ -11757,8 +11764,8 @@ function createConcurrencyLimiter(limit) {
|
|
|
11757
11764
|
|
|
11758
11765
|
// src/components/ResultsPage/SearchBar.tsx
|
|
11759
11766
|
import { useEffect as useEffect18, useRef as useRef12, useState as useState19 } from "react";
|
|
11760
|
-
import { CalendarDays as CalendarDays4, ChevronDown as
|
|
11761
|
-
import { Fragment as Fragment16, jsx as
|
|
11767
|
+
import { CalendarDays as CalendarDays4, ChevronDown as ChevronDown3, Pencil as Pencil2 } from "lucide-react";
|
|
11768
|
+
import { Fragment as Fragment16, jsx as jsx130, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
11762
11769
|
function SearchBar({
|
|
11763
11770
|
criteria,
|
|
11764
11771
|
days,
|
|
@@ -11796,7 +11803,7 @@ function SearchBar({
|
|
|
11796
11803
|
);
|
|
11797
11804
|
const dropoff = criteria.dropoffLocation === SAME_AS_PICKUP ? null : criteria.dropoffLocation;
|
|
11798
11805
|
const hasDates = !needsDates && Boolean(criteria.pickupDate || criteria.dropoffDate);
|
|
11799
|
-
const toggle = /* @__PURE__ */
|
|
11806
|
+
const toggle = /* @__PURE__ */ jsxs86(
|
|
11800
11807
|
GhostPill,
|
|
11801
11808
|
{
|
|
11802
11809
|
type: "button",
|
|
@@ -11807,13 +11814,13 @@ function SearchBar({
|
|
|
11807
11814
|
flush ? "rounded-lg" : "w-full sm:w-auto"
|
|
11808
11815
|
),
|
|
11809
11816
|
children: [
|
|
11810
|
-
/* @__PURE__ */
|
|
11811
|
-
editing ? "Close" : flush ? /* @__PURE__ */
|
|
11812
|
-
/* @__PURE__ */
|
|
11813
|
-
/* @__PURE__ */
|
|
11817
|
+
/* @__PURE__ */ jsx130(Pencil2, { className: "size-3.5", "aria-hidden": "true" }),
|
|
11818
|
+
editing ? "Close" : flush ? /* @__PURE__ */ jsxs86(Fragment16, { children: [
|
|
11819
|
+
/* @__PURE__ */ jsx130("span", { className: "sm:hidden", children: "Edit" }),
|
|
11820
|
+
/* @__PURE__ */ jsx130("span", { className: "max-sm:hidden", children: needsDates ? "Choose dates" : "Modify search" })
|
|
11814
11821
|
] }) : "Modify search",
|
|
11815
|
-
/* @__PURE__ */
|
|
11816
|
-
|
|
11822
|
+
/* @__PURE__ */ jsx130(
|
|
11823
|
+
ChevronDown3,
|
|
11817
11824
|
{
|
|
11818
11825
|
"aria-hidden": "true",
|
|
11819
11826
|
className: cn("size-3.5 transition-transform duration-200 motion-reduce:transition-none", editing && "rotate-180")
|
|
@@ -11822,19 +11829,19 @@ function SearchBar({
|
|
|
11822
11829
|
]
|
|
11823
11830
|
}
|
|
11824
11831
|
);
|
|
11825
|
-
const form = /* @__PURE__ */
|
|
11826
|
-
prompt && /* @__PURE__ */
|
|
11832
|
+
const form = /* @__PURE__ */ jsxs86(Fragment16, { children: [
|
|
11833
|
+
prompt && /* @__PURE__ */ jsxs86(
|
|
11827
11834
|
"p",
|
|
11828
11835
|
{
|
|
11829
11836
|
role: "status",
|
|
11830
11837
|
className: "mb-3 flex items-center gap-2 text-[0.9375rem] font-semibold text-listing-text sm:mb-4",
|
|
11831
11838
|
children: [
|
|
11832
|
-
/* @__PURE__ */
|
|
11839
|
+
/* @__PURE__ */ jsx130(CalendarDays4, { className: "size-4 shrink-0 text-listing-muted", "aria-hidden": "true" }),
|
|
11833
11840
|
prompt
|
|
11834
11841
|
]
|
|
11835
11842
|
}
|
|
11836
11843
|
),
|
|
11837
|
-
/* @__PURE__ */
|
|
11844
|
+
/* @__PURE__ */ jsx130(
|
|
11838
11845
|
SearchPanel,
|
|
11839
11846
|
{
|
|
11840
11847
|
initialCriteria: criteria,
|
|
@@ -11847,31 +11854,31 @@ function SearchBar({
|
|
|
11847
11854
|
)
|
|
11848
11855
|
] });
|
|
11849
11856
|
if (flush) {
|
|
11850
|
-
const place = /* @__PURE__ */
|
|
11857
|
+
const place = /* @__PURE__ */ jsxs86(Fragment16, { children: [
|
|
11851
11858
|
criteria.pickupLocation,
|
|
11852
|
-
dropoff && /* @__PURE__ */
|
|
11853
|
-
/* @__PURE__ */
|
|
11854
|
-
/* @__PURE__ */
|
|
11859
|
+
dropoff && /* @__PURE__ */ jsxs86(Fragment16, { children: [
|
|
11860
|
+
/* @__PURE__ */ jsx130("span", { className: "px-1.5 text-listing-muted", "aria-hidden": "true", children: "\u2192" }),
|
|
11861
|
+
/* @__PURE__ */ jsx130("span", { className: "sr-only", children: " to " }),
|
|
11855
11862
|
dropoff
|
|
11856
11863
|
] })
|
|
11857
11864
|
] });
|
|
11858
|
-
const dates = hasDates ? /* @__PURE__ */
|
|
11865
|
+
const dates = hasDates ? /* @__PURE__ */ jsxs86(Fragment16, { children: [
|
|
11859
11866
|
formatDateLabel(criteria.pickupDate),
|
|
11860
|
-
criteria.pickupTime && /* @__PURE__ */
|
|
11867
|
+
criteria.pickupTime && /* @__PURE__ */ jsxs86("span", { className: "font-medium text-listing-muted", children: [
|
|
11861
11868
|
" ",
|
|
11862
11869
|
criteria.pickupTime
|
|
11863
11870
|
] }),
|
|
11864
|
-
/* @__PURE__ */
|
|
11865
|
-
/* @__PURE__ */
|
|
11871
|
+
/* @__PURE__ */ jsx130("span", { className: "px-1.5 text-listing-muted", "aria-hidden": "true", children: "\u2192" }),
|
|
11872
|
+
/* @__PURE__ */ jsx130("span", { className: "sr-only", children: " to " }),
|
|
11866
11873
|
formatDateLabel(criteria.dropoffDate),
|
|
11867
|
-
criteria.dropoffTime && /* @__PURE__ */
|
|
11874
|
+
criteria.dropoffTime && /* @__PURE__ */ jsxs86("span", { className: "font-medium text-listing-muted", children: [
|
|
11868
11875
|
" ",
|
|
11869
11876
|
criteria.dropoffTime
|
|
11870
11877
|
] })
|
|
11871
11878
|
] }) : null;
|
|
11872
|
-
return /* @__PURE__ */
|
|
11873
|
-
/* @__PURE__ */
|
|
11874
|
-
/* @__PURE__ */
|
|
11879
|
+
return /* @__PURE__ */ jsxs86("div", { ref: barRef, "data-fb-summary": "", "data-editing": editing ? "true" : void 0, className: "fb-hidden", children: [
|
|
11880
|
+
/* @__PURE__ */ jsxs86("div", { className: "flex min-h-14 items-center justify-between gap-4 py-2 sm:min-h-16", children: [
|
|
11881
|
+
/* @__PURE__ */ jsxs86(
|
|
11875
11882
|
"button",
|
|
11876
11883
|
{
|
|
11877
11884
|
type: "button",
|
|
@@ -11879,23 +11886,23 @@ function SearchBar({
|
|
|
11879
11886
|
"aria-expanded": editing,
|
|
11880
11887
|
className: "fb-focus min-w-0 flex-1 rounded-md text-left sm:hidden",
|
|
11881
11888
|
children: [
|
|
11882
|
-
/* @__PURE__ */
|
|
11883
|
-
/* @__PURE__ */
|
|
11889
|
+
/* @__PURE__ */ jsx130("span", { className: "block truncate text-[0.9375rem] font-semibold text-listing-text", children: place }),
|
|
11890
|
+
/* @__PURE__ */ jsx130("span", { className: "fb-tabular block truncate text-[0.8125rem] text-listing-muted", children: dates ?? "Choose your dates" })
|
|
11884
11891
|
]
|
|
11885
11892
|
}
|
|
11886
11893
|
),
|
|
11887
|
-
/* @__PURE__ */
|
|
11888
|
-
/* @__PURE__ */
|
|
11889
|
-
/* @__PURE__ */
|
|
11890
|
-
/* @__PURE__ */
|
|
11894
|
+
/* @__PURE__ */ jsxs86("dl", { className: "m-0 flex min-w-0 flex-1 items-stretch max-sm:hidden", children: [
|
|
11895
|
+
/* @__PURE__ */ jsx130(FlushFact, { label: dropoff ? "Pick-up \u2192 return" : "Pick-up and return", children: place }),
|
|
11896
|
+
/* @__PURE__ */ jsx130(FlushFact, { divided: true, label: hasDates && days > 0 ? `Dates \xB7 ${days} ${pluralize(days, "day")}` : "Dates", children: dates ?? /* @__PURE__ */ jsx130("span", { className: "font-medium text-listing-muted", children: "Choose your dates" }) }),
|
|
11897
|
+
/* @__PURE__ */ jsxs86(FlushFact, { divided: true, label: "Driver", className: "max-xl:hidden", children: [
|
|
11891
11898
|
criteria.residency === "INT" ? "Visiting from abroad" : "South African resident",
|
|
11892
11899
|
criteria.driverAge ? `, ${criteria.driverAge}` : ""
|
|
11893
11900
|
] }),
|
|
11894
|
-
criteria.coupon && /* @__PURE__ */
|
|
11901
|
+
criteria.coupon && /* @__PURE__ */ jsx130(FlushFact, { divided: true, label: "Coupon", className: "max-xl:hidden", children: criteria.coupon })
|
|
11895
11902
|
] }),
|
|
11896
11903
|
toggle
|
|
11897
11904
|
] }),
|
|
11898
|
-
editing && /* @__PURE__ */
|
|
11905
|
+
editing && /* @__PURE__ */ jsx130(
|
|
11899
11906
|
"div",
|
|
11900
11907
|
{
|
|
11901
11908
|
ref: drawerRef,
|
|
@@ -11910,26 +11917,26 @@ function SearchBar({
|
|
|
11910
11917
|
)
|
|
11911
11918
|
] });
|
|
11912
11919
|
}
|
|
11913
|
-
return /* @__PURE__ */
|
|
11920
|
+
return /* @__PURE__ */ jsxs86(
|
|
11914
11921
|
"div",
|
|
11915
11922
|
{
|
|
11916
11923
|
ref: barRef,
|
|
11917
11924
|
className: "fb-hidden overflow-hidden rounded-2xl border border-listing-border bg-listing-bar shadow-panel",
|
|
11918
11925
|
children: [
|
|
11919
|
-
/* @__PURE__ */
|
|
11920
|
-
/* @__PURE__ */
|
|
11921
|
-
/* @__PURE__ */
|
|
11926
|
+
/* @__PURE__ */ jsxs86("div", { className: "flex flex-col gap-3 px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5", children: [
|
|
11927
|
+
/* @__PURE__ */ jsxs86("div", { className: "flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-stretch sm:gap-0 sm:divide-x sm:divide-listing-border", children: [
|
|
11928
|
+
/* @__PURE__ */ jsxs86(Fact, { label: "Pick-up", children: [
|
|
11922
11929
|
criteria.pickupLocation,
|
|
11923
|
-
dropoff && /* @__PURE__ */
|
|
11924
|
-
/* @__PURE__ */
|
|
11930
|
+
dropoff && /* @__PURE__ */ jsxs86(Fragment16, { children: [
|
|
11931
|
+
/* @__PURE__ */ jsx130("span", { className: "px-1 text-listing-muted", "aria-label": "to", children: "\u2192" }),
|
|
11925
11932
|
dropoff
|
|
11926
11933
|
] })
|
|
11927
11934
|
] }),
|
|
11928
|
-
hasDates && /* @__PURE__ */
|
|
11935
|
+
hasDates && /* @__PURE__ */ jsxs86(Fact, { label: "Dates", children: [
|
|
11929
11936
|
formatDateLabel(criteria.pickupDate) || "Any date",
|
|
11930
|
-
/* @__PURE__ */
|
|
11937
|
+
/* @__PURE__ */ jsx130("span", { className: "px-1 text-listing-muted", "aria-label": "to", children: "\u2192" }),
|
|
11931
11938
|
formatDateLabel(criteria.dropoffDate) || "Any date",
|
|
11932
|
-
days > 0 && /* @__PURE__ */
|
|
11939
|
+
days > 0 && /* @__PURE__ */ jsxs86("span", { className: "text-listing-muted", children: [
|
|
11933
11940
|
" ",
|
|
11934
11941
|
"\xB7 ",
|
|
11935
11942
|
days,
|
|
@@ -11937,16 +11944,16 @@ function SearchBar({
|
|
|
11937
11944
|
pluralize(days, "day")
|
|
11938
11945
|
] })
|
|
11939
11946
|
] }),
|
|
11940
|
-
hasDates && criteria.pickupTime && criteria.dropoffTime && /* @__PURE__ */
|
|
11947
|
+
hasDates && criteria.pickupTime && criteria.dropoffTime && /* @__PURE__ */ jsxs86(Fact, { label: "Times", children: [
|
|
11941
11948
|
criteria.pickupTime,
|
|
11942
11949
|
" \u2013 ",
|
|
11943
11950
|
criteria.dropoffTime
|
|
11944
11951
|
] }),
|
|
11945
|
-
criteria.coupon && /* @__PURE__ */
|
|
11952
|
+
criteria.coupon && /* @__PURE__ */ jsx130(Fact, { label: "Coupon", children: criteria.coupon })
|
|
11946
11953
|
] }),
|
|
11947
11954
|
toggle
|
|
11948
11955
|
] }),
|
|
11949
|
-
editing && /* @__PURE__ */
|
|
11956
|
+
editing && /* @__PURE__ */ jsx130("div", { ref: drawerRef, className: "fb-hidden border-t border-listing-border p-3 sm:p-4", children: form })
|
|
11950
11957
|
]
|
|
11951
11958
|
}
|
|
11952
11959
|
);
|
|
@@ -11957,7 +11964,7 @@ function FlushFact({
|
|
|
11957
11964
|
className,
|
|
11958
11965
|
divided = false
|
|
11959
11966
|
}) {
|
|
11960
|
-
return /* @__PURE__ */
|
|
11967
|
+
return /* @__PURE__ */ jsxs86(
|
|
11961
11968
|
"div",
|
|
11962
11969
|
{
|
|
11963
11970
|
className: cn(
|
|
@@ -11966,21 +11973,21 @@ function FlushFact({
|
|
|
11966
11973
|
className
|
|
11967
11974
|
),
|
|
11968
11975
|
children: [
|
|
11969
|
-
/* @__PURE__ */
|
|
11970
|
-
/* @__PURE__ */
|
|
11976
|
+
/* @__PURE__ */ jsx130("dt", { className: "text-[0.75rem] font-medium text-listing-muted", children: label2 }),
|
|
11977
|
+
/* @__PURE__ */ jsx130("dd", { className: "fb-tabular m-0 truncate text-[0.9375rem] font-semibold text-listing-text", children })
|
|
11971
11978
|
]
|
|
11972
11979
|
}
|
|
11973
11980
|
);
|
|
11974
11981
|
}
|
|
11975
11982
|
function Fact({ label: label2, children }) {
|
|
11976
|
-
return /* @__PURE__ */
|
|
11977
|
-
/* @__PURE__ */
|
|
11978
|
-
/* @__PURE__ */
|
|
11983
|
+
return /* @__PURE__ */ jsxs86("span", { className: "flex min-w-0 flex-col gap-0.5 sm:px-4 sm:first:pl-0 sm:last:pr-0", children: [
|
|
11984
|
+
/* @__PURE__ */ jsx130("span", { className: "text-[0.6875rem] font-medium text-listing-muted", children: label2 }),
|
|
11985
|
+
/* @__PURE__ */ jsx130("span", { className: "fb-tabular flex min-w-0 flex-wrap items-center text-[0.875rem] font-medium text-listing-text", children })
|
|
11979
11986
|
] });
|
|
11980
11987
|
}
|
|
11981
11988
|
|
|
11982
11989
|
// src/components/ResultsPage/index.tsx
|
|
11983
|
-
import { Fragment as Fragment17, jsx as
|
|
11990
|
+
import { Fragment as Fragment17, jsx as jsx131, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
11984
11991
|
function todayIso() {
|
|
11985
11992
|
const now = /* @__PURE__ */ new Date();
|
|
11986
11993
|
return [now.getFullYear(), String(now.getMonth() + 1).padStart(2, "0"), String(now.getDate()).padStart(2, "0")].join("-");
|
|
@@ -12164,16 +12171,20 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12164
12171
|
...yearBounds ? { yearRange: yearBounds } : {}
|
|
12165
12172
|
}));
|
|
12166
12173
|
}, [pool, priceBounds, yearBounds]);
|
|
12174
|
+
const comparedCars = useMemo14(
|
|
12175
|
+
() => withComparedKm(cars, filters.mileage !== null ? { minKm: filters.mileage } : {}),
|
|
12176
|
+
[cars, filters.mileage]
|
|
12177
|
+
);
|
|
12167
12178
|
const results = useMemo14(
|
|
12168
|
-
() => sortCars(filterCars(
|
|
12169
|
-
[
|
|
12179
|
+
() => sortCars(filterCars(comparedCars, filters), filters.sort),
|
|
12180
|
+
[comparedCars, filters]
|
|
12170
12181
|
);
|
|
12171
12182
|
const chips = useMemo14(
|
|
12172
12183
|
() => activeChips(filters, { price: priceBounds, year: yearBounds }),
|
|
12173
12184
|
[filters, priceBounds, yearBounds]
|
|
12174
12185
|
);
|
|
12175
12186
|
const days = useMemo14(() => rentalDays(criteria), [criteria]);
|
|
12176
|
-
const panel = /* @__PURE__ */
|
|
12187
|
+
const panel = /* @__PURE__ */ jsx131(
|
|
12177
12188
|
FilterPanel,
|
|
12178
12189
|
{
|
|
12179
12190
|
cars,
|
|
@@ -12185,7 +12196,7 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12185
12196
|
onReset: reset
|
|
12186
12197
|
}
|
|
12187
12198
|
);
|
|
12188
|
-
const summary = /* @__PURE__ */
|
|
12199
|
+
const summary = /* @__PURE__ */ jsx131(
|
|
12189
12200
|
SearchBar,
|
|
12190
12201
|
{
|
|
12191
12202
|
criteria,
|
|
@@ -12206,10 +12217,10 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12206
12217
|
const showControls = !needsDates && (!flush || searching || pool.length > 0);
|
|
12207
12218
|
const showRail = withRail && showControls;
|
|
12208
12219
|
const place = criteria.pickupLocation;
|
|
12209
|
-
return /* @__PURE__ */
|
|
12220
|
+
return /* @__PURE__ */ jsxs87("div", { className: cn("@container flex flex-col", flush ? "gap-5" : "gap-5 sm:gap-6"), children: [
|
|
12210
12221
|
summaryContainer ? createPortal3(summary, summaryContainer) : summary,
|
|
12211
|
-
filterLook === "tabs" && pool.length > 0 && !needsDates && /* @__PURE__ */
|
|
12212
|
-
/* @__PURE__ */
|
|
12222
|
+
filterLook === "tabs" && pool.length > 0 && !needsDates && /* @__PURE__ */ jsx131(CarTypeTabs, { cars, filters, priceBounds, onChange: patch, onToggle: toggle }),
|
|
12223
|
+
/* @__PURE__ */ jsxs87(
|
|
12213
12224
|
"div",
|
|
12214
12225
|
{
|
|
12215
12226
|
className: cn(
|
|
@@ -12218,7 +12229,7 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12218
12229
|
showRail && (flush ? "lg:grid-cols-[16.5rem_minmax(0,1fr)] lg:gap-0" : "lg:grid-cols-[18rem_1fr] lg:gap-8")
|
|
12219
12230
|
),
|
|
12220
12231
|
children: [
|
|
12221
|
-
showRail && /* @__PURE__ */
|
|
12232
|
+
showRail && /* @__PURE__ */ jsx131("aside", { className: cn("hidden lg:block", flush && "border-r border-listing-border pr-7"), "aria-label": "Filters", children: /* @__PURE__ */ jsx131(
|
|
12222
12233
|
"div",
|
|
12223
12234
|
{
|
|
12224
12235
|
className: cn(
|
|
@@ -12228,34 +12239,34 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12228
12239
|
children: panel
|
|
12229
12240
|
}
|
|
12230
12241
|
) }),
|
|
12231
|
-
/* @__PURE__ */
|
|
12242
|
+
/* @__PURE__ */ jsx131("div", { className: cn("min-w-0", showRail && flush && "lg:pl-8"), children: needsDates ? (
|
|
12232
12243
|
// While the form is open its own prompt says it; this is for after it is closed.
|
|
12233
|
-
!editingSearch && /* @__PURE__ */
|
|
12234
|
-
) : /* @__PURE__ */
|
|
12235
|
-
showControls && /* @__PURE__ */
|
|
12236
|
-
/* @__PURE__ */
|
|
12237
|
-
/* @__PURE__ */
|
|
12238
|
-
/* @__PURE__ */
|
|
12244
|
+
!editingSearch && /* @__PURE__ */ jsx131(ChooseDates, { place, past: problem === "past", flush, onChoose: openEditor })
|
|
12245
|
+
) : /* @__PURE__ */ jsxs87(Fragment17, { children: [
|
|
12246
|
+
showControls && /* @__PURE__ */ jsxs87("div", { className: "flex flex-wrap items-end justify-between gap-3 border-b border-listing-border pb-4", children: [
|
|
12247
|
+
/* @__PURE__ */ jsxs87("div", { "aria-live": "polite", children: [
|
|
12248
|
+
/* @__PURE__ */ jsx131("h2", { className: "text-[1.25rem] leading-tight font-semibold tracking-[-0.02em] text-listing-text sm:text-[1.5rem]", children: availabilityQuery.isPending ? "Finding cars\u2026" : /* @__PURE__ */ jsxs87(Fragment17, { children: [
|
|
12249
|
+
/* @__PURE__ */ jsx131("span", { className: "fb-tabular", children: results.length }),
|
|
12239
12250
|
" ",
|
|
12240
12251
|
pluralize(results.length, "car"),
|
|
12241
12252
|
" ",
|
|
12242
12253
|
"available"
|
|
12243
12254
|
] }) }),
|
|
12244
|
-
days > 0 && /* @__PURE__ */
|
|
12245
|
-
flush && /* @__PURE__ */
|
|
12255
|
+
days > 0 && /* @__PURE__ */ jsxs87("p", { className: "mt-1 text-[0.8125rem] text-listing-muted", children: [
|
|
12256
|
+
flush && /* @__PURE__ */ jsxs87(Fragment17, { children: [
|
|
12246
12257
|
place,
|
|
12247
12258
|
" \xB7 "
|
|
12248
12259
|
] }),
|
|
12249
12260
|
"Prices for ",
|
|
12250
|
-
/* @__PURE__ */
|
|
12261
|
+
/* @__PURE__ */ jsx131("span", { className: "fb-tabular", children: days }),
|
|
12251
12262
|
" ",
|
|
12252
12263
|
pluralize(days, "day"),
|
|
12253
12264
|
", before any add-ons"
|
|
12254
12265
|
] })
|
|
12255
12266
|
] }),
|
|
12256
|
-
/* @__PURE__ */
|
|
12257
|
-
filterLook !== "chips" && /* @__PURE__ */
|
|
12258
|
-
/* @__PURE__ */
|
|
12267
|
+
/* @__PURE__ */ jsxs87("div", { className: "flex items-center gap-2", children: [
|
|
12268
|
+
filterLook !== "chips" && /* @__PURE__ */ jsxs87(Sheet, { open: filtersOpen, onOpenChange: setFiltersOpen, children: [
|
|
12269
|
+
/* @__PURE__ */ jsx131(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs87(
|
|
12259
12270
|
GhostPill,
|
|
12260
12271
|
{
|
|
12261
12272
|
className: cn(
|
|
@@ -12265,21 +12276,21 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12265
12276
|
filterLook === "button" && "border-transparent bg-listing-text text-listing-sidebar hover:bg-listing-text/90"
|
|
12266
12277
|
),
|
|
12267
12278
|
children: [
|
|
12268
|
-
/* @__PURE__ */
|
|
12279
|
+
/* @__PURE__ */ jsx131(SlidersHorizontal2, { className: "size-3.5" }),
|
|
12269
12280
|
filterLook === "tabs" ? "More filters" : "Filters",
|
|
12270
|
-
chips.length > 0 && /* @__PURE__ */
|
|
12281
|
+
chips.length > 0 && /* @__PURE__ */ jsx131("span", { className: "fb-tabular grid size-5 place-items-center rounded-full bg-filter-pill-active text-[0.625rem] font-semibold text-filter-pill-active-fg", children: chips.length })
|
|
12271
12282
|
]
|
|
12272
12283
|
}
|
|
12273
12284
|
) }),
|
|
12274
|
-
/* @__PURE__ */
|
|
12285
|
+
/* @__PURE__ */ jsxs87(
|
|
12275
12286
|
SheetContent,
|
|
12276
12287
|
{
|
|
12277
12288
|
side: filterLook === "button" ? "right" : "left",
|
|
12278
12289
|
className: "overflow-y-auto data-[side=left]:w-full data-[side=left]:sm:max-w-sm data-[side=right]:w-full data-[side=right]:sm:max-w-sm",
|
|
12279
12290
|
children: [
|
|
12280
|
-
/* @__PURE__ */
|
|
12281
|
-
/* @__PURE__ */
|
|
12282
|
-
/* @__PURE__ */
|
|
12291
|
+
/* @__PURE__ */ jsx131(SheetHeader, { className: "pb-0", children: /* @__PURE__ */ jsx131(SheetTitle, { className: "text-base", children: "Filters" }) }),
|
|
12292
|
+
/* @__PURE__ */ jsx131("div", { className: "px-5 pb-6", children: panel }),
|
|
12293
|
+
/* @__PURE__ */ jsx131("div", { className: "sticky bottom-0 mt-auto border-t border-listing-border bg-popover px-5 py-4", children: /* @__PURE__ */ jsxs87(
|
|
12283
12294
|
"button",
|
|
12284
12295
|
{
|
|
12285
12296
|
type: "button",
|
|
@@ -12287,7 +12298,7 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12287
12298
|
className: "fb-focus h-12 w-full rounded-xl bg-car-cta text-[0.9375rem] font-semibold text-car-cta-fg transition-transform active:scale-[0.98]",
|
|
12288
12299
|
children: [
|
|
12289
12300
|
"Show ",
|
|
12290
|
-
/* @__PURE__ */
|
|
12301
|
+
/* @__PURE__ */ jsx131("span", { className: "fb-tabular", children: results.length }),
|
|
12291
12302
|
" ",
|
|
12292
12303
|
pluralize(results.length, "car")
|
|
12293
12304
|
]
|
|
@@ -12297,13 +12308,13 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12297
12308
|
}
|
|
12298
12309
|
)
|
|
12299
12310
|
] }),
|
|
12300
|
-
/* @__PURE__ */
|
|
12311
|
+
/* @__PURE__ */ jsxs87(
|
|
12301
12312
|
Select,
|
|
12302
12313
|
{
|
|
12303
12314
|
value: filters.sort,
|
|
12304
12315
|
onValueChange: (value) => patch({ sort: value }),
|
|
12305
12316
|
children: [
|
|
12306
|
-
/* @__PURE__ */
|
|
12317
|
+
/* @__PURE__ */ jsxs87(
|
|
12307
12318
|
SelectTrigger,
|
|
12308
12319
|
{
|
|
12309
12320
|
"aria-label": "Sort results",
|
|
@@ -12312,18 +12323,18 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12312
12323
|
flush ? "rounded-lg" : "rounded-full"
|
|
12313
12324
|
),
|
|
12314
12325
|
children: [
|
|
12315
|
-
/* @__PURE__ */
|
|
12316
|
-
/* @__PURE__ */
|
|
12326
|
+
/* @__PURE__ */ jsx131(ArrowUpDown, { className: "size-3.5 shrink-0 text-listing-muted", "aria-hidden": "true" }),
|
|
12327
|
+
/* @__PURE__ */ jsx131(SelectValue, {})
|
|
12317
12328
|
]
|
|
12318
12329
|
}
|
|
12319
12330
|
),
|
|
12320
|
-
/* @__PURE__ */
|
|
12331
|
+
/* @__PURE__ */ jsx131(SelectContent, { align: "end", children: SORT_OPTIONS.map((option) => /* @__PURE__ */ jsx131(SelectItem, { value: option.value, className: "text-[0.8125rem]", children: option.label }, option.value)) })
|
|
12321
12332
|
]
|
|
12322
12333
|
}
|
|
12323
12334
|
)
|
|
12324
12335
|
] })
|
|
12325
12336
|
] }),
|
|
12326
|
-
filterLook === "chips" && pool.length > 0 && /* @__PURE__ */
|
|
12337
|
+
filterLook === "chips" && pool.length > 0 && /* @__PURE__ */ jsx131(
|
|
12327
12338
|
FilterChipBar,
|
|
12328
12339
|
{
|
|
12329
12340
|
className: "mt-4",
|
|
@@ -12336,8 +12347,8 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12336
12347
|
onReset: reset
|
|
12337
12348
|
}
|
|
12338
12349
|
),
|
|
12339
|
-
chips.length > 0 && filterLook !== "chips" && /* @__PURE__ */
|
|
12340
|
-
chips.map((chip) => /* @__PURE__ */
|
|
12350
|
+
chips.length > 0 && filterLook !== "chips" && /* @__PURE__ */ jsxs87("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
12351
|
+
chips.map((chip) => /* @__PURE__ */ jsxs87(
|
|
12341
12352
|
"button",
|
|
12342
12353
|
{
|
|
12343
12354
|
type: "button",
|
|
@@ -12345,13 +12356,13 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12345
12356
|
className: "fb-focus flex h-8 items-center gap-1.5 rounded-full border border-listing-border bg-listing-chip pr-2 pl-3 text-[0.75rem] font-medium text-listing-chip-fg transition-colors duration-200 hover:border-listing-text/30",
|
|
12346
12357
|
children: [
|
|
12347
12358
|
chip.label,
|
|
12348
|
-
/* @__PURE__ */
|
|
12349
|
-
/* @__PURE__ */
|
|
12359
|
+
/* @__PURE__ */ jsx131(X5, { className: "size-3.5 opacity-60", "aria-hidden": "true" }),
|
|
12360
|
+
/* @__PURE__ */ jsx131("span", { className: "sr-only", children: "Remove filter" })
|
|
12350
12361
|
]
|
|
12351
12362
|
},
|
|
12352
12363
|
chip.id
|
|
12353
12364
|
)),
|
|
12354
|
-
/* @__PURE__ */
|
|
12365
|
+
/* @__PURE__ */ jsx131(
|
|
12355
12366
|
"button",
|
|
12356
12367
|
{
|
|
12357
12368
|
type: "button",
|
|
@@ -12361,49 +12372,49 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12361
12372
|
}
|
|
12362
12373
|
)
|
|
12363
12374
|
] }),
|
|
12364
|
-
searching ? /* @__PURE__ */
|
|
12365
|
-
/* @__PURE__ */
|
|
12366
|
-
/* @__PURE__ */
|
|
12367
|
-
] }) : failed && flush ? /* @__PURE__ */
|
|
12375
|
+
searching ? /* @__PURE__ */ jsxs87(Fragment17, { children: [
|
|
12376
|
+
/* @__PURE__ */ jsx131(SourceChips, { sources: progress }),
|
|
12377
|
+
/* @__PURE__ */ jsx131(CarListSkeleton, { listStyle, className: "mt-5" })
|
|
12378
|
+
] }) : failed && flush ? /* @__PURE__ */ jsxs87(
|
|
12368
12379
|
InlineState,
|
|
12369
12380
|
{
|
|
12370
12381
|
alert: true,
|
|
12371
|
-
icon: /* @__PURE__ */
|
|
12382
|
+
icon: /* @__PURE__ */ jsx131(CircleAlert4, { className: "size-5", "aria-hidden": "true" }),
|
|
12372
12383
|
title: "We couldn\u2019t finish that search",
|
|
12373
12384
|
body: errorMessage || "Something went wrong on our side. Please try again in a moment.",
|
|
12374
12385
|
children: [
|
|
12375
|
-
/* @__PURE__ */
|
|
12376
|
-
/* @__PURE__ */
|
|
12386
|
+
/* @__PURE__ */ jsxs87(CtaButton, { type: "button", onClick: () => availabilityQuery.refetch(), children: [
|
|
12387
|
+
/* @__PURE__ */ jsx131(RotateCw, { className: "size-4", "aria-hidden": "true" }),
|
|
12377
12388
|
"Try again"
|
|
12378
12389
|
] }),
|
|
12379
|
-
/* @__PURE__ */
|
|
12390
|
+
/* @__PURE__ */ jsx131(GhostPill, { type: "button", onClick: openEditor, className: "h-10 rounded-lg px-4", children: "Modify search" })
|
|
12380
12391
|
]
|
|
12381
12392
|
}
|
|
12382
|
-
) : failed ? /* @__PURE__ */
|
|
12393
|
+
) : failed ? /* @__PURE__ */ jsxs87(
|
|
12383
12394
|
"div",
|
|
12384
12395
|
{
|
|
12385
12396
|
role: "alert",
|
|
12386
12397
|
className: "fb-card mt-5 flex flex-col items-center justify-center gap-2 px-6 py-16 text-center",
|
|
12387
12398
|
children: [
|
|
12388
|
-
/* @__PURE__ */
|
|
12389
|
-
/* @__PURE__ */
|
|
12390
|
-
/* @__PURE__ */
|
|
12391
|
-
/* @__PURE__ */
|
|
12399
|
+
/* @__PURE__ */ jsx131("span", { className: "mb-2 grid size-12 place-items-center rounded-full bg-destructive/10 text-destructive", children: /* @__PURE__ */ jsx131(CircleAlert4, { className: "size-5", "aria-hidden": "true" }) }),
|
|
12400
|
+
/* @__PURE__ */ jsx131("p", { className: "text-base font-semibold text-foreground", children: "We couldn't finish that search" }),
|
|
12401
|
+
/* @__PURE__ */ jsx131("p", { className: "max-w-sm text-[0.875rem] leading-relaxed text-muted-foreground", children: availabilityQuery.error instanceof Error ? availabilityQuery.error.message : "Please try again." }),
|
|
12402
|
+
/* @__PURE__ */ jsx131(GhostPill, { type: "button", onClick: () => setEditingSearch(true), className: "mt-3", children: "Modify search" })
|
|
12392
12403
|
]
|
|
12393
12404
|
}
|
|
12394
|
-
) : /* @__PURE__ */
|
|
12395
|
-
flush && nothingFound && /* @__PURE__ */
|
|
12405
|
+
) : /* @__PURE__ */ jsxs87(Fragment17, { children: [
|
|
12406
|
+
flush && nothingFound && /* @__PURE__ */ jsx131(
|
|
12396
12407
|
InlineState,
|
|
12397
12408
|
{
|
|
12398
|
-
icon: /* @__PURE__ */
|
|
12409
|
+
icon: /* @__PURE__ */ jsx131(CalendarDays5, { className: "size-5", "aria-hidden": "true" }),
|
|
12399
12410
|
title: `No cars at ${place} for these dates`,
|
|
12400
12411
|
body: "The suppliers we asked are fully booked or closed at those times. Other dates, times or a nearby branch often turn something up.",
|
|
12401
|
-
children: /* @__PURE__ */
|
|
12412
|
+
children: /* @__PURE__ */ jsx131(CtaButton, { type: "button", onClick: openEditor, children: "Change the search" })
|
|
12402
12413
|
}
|
|
12403
12414
|
),
|
|
12404
|
-
isOffersResult(availabilityQuery.data) && /* @__PURE__ */
|
|
12405
|
-
notices.length > 0 && /* @__PURE__ */
|
|
12406
|
-
!(flush && nothingFound) && /* @__PURE__ */
|
|
12415
|
+
isOffersResult(availabilityQuery.data) && /* @__PURE__ */ jsx131(SourceChips, { sources: availabilityQuery.data.sources ?? [] }),
|
|
12416
|
+
notices.length > 0 && /* @__PURE__ */ jsx131(SourceNotices, { title: results.length > 0 ? "Some cars are not shown" : "Why there are no cars", notices }),
|
|
12417
|
+
!(flush && nothingFound) && /* @__PURE__ */ jsx131(
|
|
12407
12418
|
CarList,
|
|
12408
12419
|
{
|
|
12409
12420
|
cars: results,
|
|
@@ -12428,7 +12439,7 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12428
12439
|
]
|
|
12429
12440
|
}
|
|
12430
12441
|
),
|
|
12431
|
-
booking && /* @__PURE__ */
|
|
12442
|
+
booking && /* @__PURE__ */ jsx131(
|
|
12432
12443
|
BookingWizard,
|
|
12433
12444
|
{
|
|
12434
12445
|
car: booking,
|
|
@@ -12448,8 +12459,8 @@ function ResultsPage({ bookingUrl: bookingUrlProp, listStyle, layout = "boxed",
|
|
|
12448
12459
|
function SourceNotices({ title, notices }) {
|
|
12449
12460
|
const [open, setOpen] = useState20(false);
|
|
12450
12461
|
const panelId = useId4();
|
|
12451
|
-
return /* @__PURE__ */
|
|
12452
|
-
/* @__PURE__ */
|
|
12462
|
+
return /* @__PURE__ */ jsxs87("div", { role: "status", className: "mt-5 rounded-2xl border border-listing-border bg-listing-chip", children: [
|
|
12463
|
+
/* @__PURE__ */ jsxs87(
|
|
12453
12464
|
"button",
|
|
12454
12465
|
{
|
|
12455
12466
|
type: "button",
|
|
@@ -12458,11 +12469,11 @@ function SourceNotices({ title, notices }) {
|
|
|
12458
12469
|
"aria-controls": panelId,
|
|
12459
12470
|
className: "fb-focus flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left",
|
|
12460
12471
|
children: [
|
|
12461
|
-
/* @__PURE__ */
|
|
12462
|
-
/* @__PURE__ */
|
|
12463
|
-
/* @__PURE__ */
|
|
12464
|
-
/* @__PURE__ */
|
|
12465
|
-
|
|
12472
|
+
/* @__PURE__ */ jsx131(Info5, { className: "size-4 shrink-0 text-listing-muted", "aria-hidden": "true" }),
|
|
12473
|
+
/* @__PURE__ */ jsx131("span", { className: "min-w-0 flex-1 text-[0.8125rem] font-semibold text-listing-text", children: title }),
|
|
12474
|
+
/* @__PURE__ */ jsx131("span", { className: "rounded-full bg-white px-2 py-0.5 text-[0.75rem] font-semibold tabular-nums text-listing-muted", children: notices.length }),
|
|
12475
|
+
/* @__PURE__ */ jsx131(
|
|
12476
|
+
ChevronDown4,
|
|
12466
12477
|
{
|
|
12467
12478
|
className: cn("size-4 shrink-0 text-listing-muted transition-transform duration-200 motion-reduce:transition-none", open && "rotate-180"),
|
|
12468
12479
|
"aria-hidden": "true"
|
|
@@ -12471,7 +12482,7 @@ function SourceNotices({ title, notices }) {
|
|
|
12471
12482
|
]
|
|
12472
12483
|
}
|
|
12473
12484
|
),
|
|
12474
|
-
/* @__PURE__ */
|
|
12485
|
+
/* @__PURE__ */ jsx131("div", { id: panelId, hidden: !open, children: /* @__PURE__ */ jsx131("ul", { className: "space-y-0.5 px-4 pb-3.5 pl-11 text-[0.8125rem] leading-relaxed text-listing-muted", children: notices.map((notice) => /* @__PURE__ */ jsx131("li", { className: "list-disc", children: notice }, notice)) }) })
|
|
12475
12486
|
] });
|
|
12476
12487
|
}
|
|
12477
12488
|
function InlineState({
|
|
@@ -12481,8 +12492,8 @@ function InlineState({
|
|
|
12481
12492
|
alert = false,
|
|
12482
12493
|
children
|
|
12483
12494
|
}) {
|
|
12484
|
-
return /* @__PURE__ */
|
|
12485
|
-
/* @__PURE__ */
|
|
12495
|
+
return /* @__PURE__ */ jsxs87("div", { role: alert ? "alert" : "status", className: "flex flex-col items-center px-4 py-14 text-center sm:py-20", children: [
|
|
12496
|
+
/* @__PURE__ */ jsx131(
|
|
12486
12497
|
"span",
|
|
12487
12498
|
{
|
|
12488
12499
|
className: cn(
|
|
@@ -12492,20 +12503,20 @@ function InlineState({
|
|
|
12492
12503
|
children: icon
|
|
12493
12504
|
}
|
|
12494
12505
|
),
|
|
12495
|
-
/* @__PURE__ */
|
|
12496
|
-
/* @__PURE__ */
|
|
12497
|
-
children && /* @__PURE__ */
|
|
12506
|
+
/* @__PURE__ */ jsx131("h2", { className: "mt-4 max-w-[460px] text-[1.125rem] leading-snug font-semibold tracking-[-0.01em] text-listing-text sm:text-[1.25rem]", children: title }),
|
|
12507
|
+
/* @__PURE__ */ jsx131("p", { className: "mt-2 max-w-[460px] text-[0.875rem] leading-relaxed text-listing-muted", children: body }),
|
|
12508
|
+
children && /* @__PURE__ */ jsx131("div", { className: "mt-6 flex flex-wrap items-center justify-center gap-2", children })
|
|
12498
12509
|
] });
|
|
12499
12510
|
}
|
|
12500
12511
|
function ChooseDates({ place, past, flush, onChoose }) {
|
|
12501
|
-
return /* @__PURE__ */
|
|
12512
|
+
return /* @__PURE__ */ jsx131("div", { className: cn(!flush && "fb-card px-6"), children: /* @__PURE__ */ jsx131(
|
|
12502
12513
|
InlineState,
|
|
12503
12514
|
{
|
|
12504
|
-
icon: /* @__PURE__ */
|
|
12515
|
+
icon: /* @__PURE__ */ jsx131(CalendarDays5, { className: "size-5", "aria-hidden": "true" }),
|
|
12505
12516
|
title: past ? "Those dates have passed" : `Choose your dates to see cars at ${place}`,
|
|
12506
12517
|
body: "Prices and availability depend on when you collect and return the car. Pick your dates and times above and we will search every supplier for you.",
|
|
12507
|
-
children: /* @__PURE__ */
|
|
12508
|
-
/* @__PURE__ */
|
|
12518
|
+
children: /* @__PURE__ */ jsxs87(CtaButton, { type: "button", onClick: onChoose, children: [
|
|
12519
|
+
/* @__PURE__ */ jsx131(CalendarDays5, { className: "size-4", "aria-hidden": "true" }),
|
|
12509
12520
|
"Choose dates"
|
|
12510
12521
|
] })
|
|
12511
12522
|
}
|
|
@@ -12522,7 +12533,7 @@ import { useForm } from "react-hook-form";
|
|
|
12522
12533
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
12523
12534
|
import { z } from "zod";
|
|
12524
12535
|
import { KeyRound as KeyRound2, Mail as Mail5, Search as Search4, TicketCheck } from "lucide-react";
|
|
12525
|
-
import { jsx as
|
|
12536
|
+
import { jsx as jsx132, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
12526
12537
|
var lookupSchema = z.object({
|
|
12527
12538
|
reservationNumber: z.string().trim().min(1, "Enter your booking number"),
|
|
12528
12539
|
bookingPin: z.string().trim().min(1, "Enter your PIN")
|
|
@@ -12545,19 +12556,19 @@ function LookupForm({ onFound, defaultReservationNumber = "", defaultBookingPin
|
|
|
12545
12556
|
}
|
|
12546
12557
|
onFound(reservationNumber, pin, result.data.booking);
|
|
12547
12558
|
};
|
|
12548
|
-
const field = (name, label2, Icon, placeholder, options = {}) => /* @__PURE__ */
|
|
12559
|
+
const field = (name, label2, Icon, placeholder, options = {}) => /* @__PURE__ */ jsx132(
|
|
12549
12560
|
FormField,
|
|
12550
12561
|
{
|
|
12551
12562
|
control: form.control,
|
|
12552
12563
|
name,
|
|
12553
|
-
render: ({ field: input, fieldState }) => /* @__PURE__ */
|
|
12554
|
-
/* @__PURE__ */
|
|
12555
|
-
options.number && /* @__PURE__ */
|
|
12564
|
+
render: ({ field: input, fieldState }) => /* @__PURE__ */ jsxs88(FormItem, { className: cn(options.bare && "gap-0.5 px-3 py-1.5"), children: [
|
|
12565
|
+
/* @__PURE__ */ jsxs88(FormLabel, { className: cn("flex items-center gap-2 font-medium text-foreground", options.bare ? "text-[0.6875rem] font-semibold tracking-[0.04em] uppercase" : "text-[0.8125rem]"), children: [
|
|
12566
|
+
options.number && /* @__PURE__ */ jsx132("span", { className: "grid size-5 place-items-center rounded-full bg-wizard-selected text-[0.6875rem] font-bold text-wizard-selected-fg", "aria-hidden": "true", children: options.number }),
|
|
12556
12567
|
label2
|
|
12557
12568
|
] }),
|
|
12558
|
-
/* @__PURE__ */
|
|
12559
|
-
!options.bare && /* @__PURE__ */
|
|
12560
|
-
/* @__PURE__ */
|
|
12569
|
+
/* @__PURE__ */ jsxs88("div", { className: "relative", children: [
|
|
12570
|
+
!options.bare && /* @__PURE__ */ jsx132(Icon, { className: "pointer-events-none absolute top-1/2 left-3.5 size-4 -translate-y-1/2 text-muted-foreground", "aria-hidden": "true" }),
|
|
12571
|
+
/* @__PURE__ */ jsx132(FormControl, { children: /* @__PURE__ */ jsx132(
|
|
12561
12572
|
Input,
|
|
12562
12573
|
{
|
|
12563
12574
|
placeholder,
|
|
@@ -12573,103 +12584,103 @@ function LookupForm({ onFound, defaultReservationNumber = "", defaultBookingPin
|
|
|
12573
12584
|
}
|
|
12574
12585
|
) })
|
|
12575
12586
|
] }),
|
|
12576
|
-
/* @__PURE__ */
|
|
12587
|
+
/* @__PURE__ */ jsx132(FormMessage, {})
|
|
12577
12588
|
] })
|
|
12578
12589
|
}
|
|
12579
12590
|
);
|
|
12580
|
-
const error = form.formState.errors.root && /* @__PURE__ */
|
|
12591
|
+
const error = form.formState.errors.root && /* @__PURE__ */ jsx132(Notice, { tone: "error", children: form.formState.errors.root.message });
|
|
12581
12592
|
const buttonText = form.formState.isSubmitting ? "Looking up\u2026" : "Find booking";
|
|
12582
12593
|
if (look === "banner") {
|
|
12583
|
-
return /* @__PURE__ */
|
|
12584
|
-
/* @__PURE__ */
|
|
12594
|
+
return /* @__PURE__ */ jsxs88("section", { className: "relative overflow-hidden rounded-3xl bg-wizard-selected px-5 py-8 text-wizard-selected-fg sm:px-8 sm:py-10", children: [
|
|
12595
|
+
/* @__PURE__ */ jsx132(
|
|
12585
12596
|
"span",
|
|
12586
12597
|
{
|
|
12587
12598
|
className: "pointer-events-none absolute inset-0 bg-[repeating-linear-gradient(115deg,rgba(255,255,255,0.07)_0_2px,transparent_2px_22px)]",
|
|
12588
12599
|
"aria-hidden": "true"
|
|
12589
12600
|
}
|
|
12590
12601
|
),
|
|
12591
|
-
/* @__PURE__ */
|
|
12592
|
-
/* @__PURE__ */
|
|
12593
|
-
/* @__PURE__ */
|
|
12594
|
-
/* @__PURE__ */
|
|
12602
|
+
/* @__PURE__ */ jsxs88("div", { className: "relative", children: [
|
|
12603
|
+
/* @__PURE__ */ jsx132("h2", { className: "max-w-[22ch] text-[1.5rem] leading-tight font-bold tracking-[-0.02em] text-balance sm:text-[2rem]", children: "Change or cancel your booking" }),
|
|
12604
|
+
/* @__PURE__ */ jsx132("p", { className: "mt-1.5 text-[0.875rem] opacity-85", children: "Enter the booking number and PIN from your confirmation email." }),
|
|
12605
|
+
/* @__PURE__ */ jsx132(Form, { ...form, children: /* @__PURE__ */ jsxs88(
|
|
12595
12606
|
"form",
|
|
12596
12607
|
{
|
|
12597
12608
|
onSubmit: form.handleSubmit(onSubmit),
|
|
12598
12609
|
className: "mt-6 grid gap-1 rounded-2xl bg-card p-1.5 text-foreground shadow-2xl sm:grid-cols-[1.3fr_1fr_auto] sm:items-center",
|
|
12599
12610
|
children: [
|
|
12600
12611
|
field("reservationNumber", "Booking number", TicketCheck, "e.g. 123456", { bare: true }),
|
|
12601
|
-
/* @__PURE__ */
|
|
12602
|
-
/* @__PURE__ */
|
|
12603
|
-
/* @__PURE__ */
|
|
12612
|
+
/* @__PURE__ */ jsx132("div", { className: "border-t border-border sm:border-t-0 sm:border-l", children: field("bookingPin", "PIN", KeyRound2, "XXXXXX", { pin: true, bare: true }) }),
|
|
12613
|
+
/* @__PURE__ */ jsxs88(CtaButton, { type: "submit", className: "h-12 rounded-xl px-6 text-[0.9375rem]", disabled: form.formState.isSubmitting, children: [
|
|
12614
|
+
/* @__PURE__ */ jsx132(Search4, { className: "size-4", "aria-hidden": "true" }),
|
|
12604
12615
|
form.formState.isSubmitting ? "Looking up\u2026" : "Find"
|
|
12605
12616
|
] })
|
|
12606
12617
|
]
|
|
12607
12618
|
}
|
|
12608
12619
|
) }),
|
|
12609
|
-
error && /* @__PURE__ */
|
|
12620
|
+
error && /* @__PURE__ */ jsx132("div", { className: "mt-3 text-foreground", children: error })
|
|
12610
12621
|
] })
|
|
12611
12622
|
] });
|
|
12612
12623
|
}
|
|
12613
12624
|
if (look === "help") {
|
|
12614
|
-
return /* @__PURE__ */
|
|
12615
|
-
/* @__PURE__ */
|
|
12616
|
-
/* @__PURE__ */
|
|
12617
|
-
/* @__PURE__ */
|
|
12618
|
-
/* @__PURE__ */
|
|
12619
|
-
/* @__PURE__ */
|
|
12620
|
-
/* @__PURE__ */
|
|
12621
|
-
/* @__PURE__ */
|
|
12622
|
-
/* @__PURE__ */
|
|
12625
|
+
return /* @__PURE__ */ jsxs88("section", { className: "grid overflow-hidden rounded-3xl border border-border shadow-xl md:grid-cols-2", children: [
|
|
12626
|
+
/* @__PURE__ */ jsxs88("div", { className: "flex flex-col gap-4 bg-wizard-selected p-6 text-wizard-selected-fg sm:p-8", children: [
|
|
12627
|
+
/* @__PURE__ */ jsx132("p", { className: "fb-eyebrow opacity-85", children: "Can't find them?" }),
|
|
12628
|
+
/* @__PURE__ */ jsx132("h2", { className: "text-[1.375rem] leading-tight font-bold tracking-[-0.02em] text-balance", children: "They're at the top of your confirmation email" }),
|
|
12629
|
+
/* @__PURE__ */ jsxs88("div", { className: "mx-auto mt-2 w-full max-w-[16rem] -rotate-3 rounded-[1.75rem] border-[5px] border-foreground bg-card p-3 text-foreground shadow-2xl", "aria-hidden": "true", children: [
|
|
12630
|
+
/* @__PURE__ */ jsx132("span", { className: "mx-auto mb-3 block h-1.5 w-14 rounded-full bg-foreground" }),
|
|
12631
|
+
/* @__PURE__ */ jsxs88("span", { className: "flex items-center gap-2 text-[0.75rem] font-semibold", children: [
|
|
12632
|
+
/* @__PURE__ */ jsx132("span", { className: "grid size-7 place-items-center rounded-lg bg-wizard-selected text-wizard-selected-fg", children: /* @__PURE__ */ jsx132(Mail5, { className: "size-3.5" }) }),
|
|
12633
|
+
/* @__PURE__ */ jsxs88("span", { children: [
|
|
12623
12634
|
"Your booking is confirmed",
|
|
12624
|
-
/* @__PURE__ */
|
|
12635
|
+
/* @__PURE__ */ jsx132("span", { className: "block text-[0.6875rem] font-normal text-muted-foreground", children: "Booking details inside" })
|
|
12625
12636
|
] })
|
|
12626
12637
|
] }),
|
|
12627
|
-
/* @__PURE__ */
|
|
12638
|
+
/* @__PURE__ */ jsx132("span", { className: "mt-3 block h-1.5 w-3/4 rounded bg-surface-2" }),
|
|
12628
12639
|
[
|
|
12629
12640
|
["1", "Booking number", "123456"],
|
|
12630
12641
|
["2", "PIN", "A1B2C3"]
|
|
12631
|
-
].map(([n, label2, sample]) => /* @__PURE__ */
|
|
12632
|
-
/* @__PURE__ */
|
|
12633
|
-
/* @__PURE__ */
|
|
12634
|
-
/* @__PURE__ */
|
|
12642
|
+
].map(([n, label2, sample]) => /* @__PURE__ */ jsxs88("span", { className: "mt-2 flex items-center gap-2 rounded-lg bg-wizard-selected/12 px-2 py-1.5 ring-2 ring-wizard-selected", children: [
|
|
12643
|
+
/* @__PURE__ */ jsx132("span", { className: "grid size-5 place-items-center rounded-full bg-wizard-selected text-[0.6875rem] font-bold text-wizard-selected-fg", children: n }),
|
|
12644
|
+
/* @__PURE__ */ jsx132("span", { className: "text-[0.6875rem] text-muted-foreground", children: label2 }),
|
|
12645
|
+
/* @__PURE__ */ jsx132("span", { className: "ml-auto font-mono text-[0.75rem] font-semibold", children: sample })
|
|
12635
12646
|
] }, n)),
|
|
12636
|
-
/* @__PURE__ */
|
|
12637
|
-
/* @__PURE__ */
|
|
12647
|
+
/* @__PURE__ */ jsx132("span", { className: "mt-3 block h-1.5 rounded bg-surface-2" }),
|
|
12648
|
+
/* @__PURE__ */ jsx132("span", { className: "mt-1.5 block h-1.5 w-1/2 rounded bg-surface-2" })
|
|
12638
12649
|
] })
|
|
12639
12650
|
] }),
|
|
12640
|
-
/* @__PURE__ */
|
|
12641
|
-
/* @__PURE__ */
|
|
12651
|
+
/* @__PURE__ */ jsx132(Form, { ...form, children: /* @__PURE__ */ jsxs88("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col justify-center gap-4 bg-card p-6 sm:p-8", children: [
|
|
12652
|
+
/* @__PURE__ */ jsx132("h2", { className: "text-[1.375rem] leading-tight font-bold tracking-[-0.02em] text-foreground", children: "Find your booking" }),
|
|
12642
12653
|
field("reservationNumber", "Booking number", TicketCheck, "e.g. 123456", { number: 1 }),
|
|
12643
12654
|
field("bookingPin", "PIN", KeyRound2, "XXXXXX", { pin: true, number: 2 }),
|
|
12644
12655
|
error,
|
|
12645
|
-
/* @__PURE__ */
|
|
12646
|
-
/* @__PURE__ */
|
|
12656
|
+
/* @__PURE__ */ jsxs88(CtaButton, { type: "submit", className: "mt-1 h-12 w-full text-[0.9375rem]", disabled: form.formState.isSubmitting, children: [
|
|
12657
|
+
/* @__PURE__ */ jsx132(Search4, { className: "size-4", "aria-hidden": "true" }),
|
|
12647
12658
|
buttonText
|
|
12648
12659
|
] })
|
|
12649
12660
|
] }) })
|
|
12650
12661
|
] });
|
|
12651
12662
|
}
|
|
12652
|
-
return /* @__PURE__ */
|
|
12653
|
-
/* @__PURE__ */
|
|
12654
|
-
/* @__PURE__ */
|
|
12663
|
+
return /* @__PURE__ */ jsxs88("div", { className: "flex flex-col gap-6", children: [
|
|
12664
|
+
/* @__PURE__ */ jsxs88("header", { className: "flex flex-col items-start gap-4", children: [
|
|
12665
|
+
/* @__PURE__ */ jsx132(
|
|
12655
12666
|
"span",
|
|
12656
12667
|
{
|
|
12657
12668
|
"aria-hidden": "true",
|
|
12658
12669
|
className: "grid size-12 place-items-center rounded-2xl bg-wizard-selected text-wizard-selected-fg shadow-sm",
|
|
12659
|
-
children: /* @__PURE__ */
|
|
12670
|
+
children: /* @__PURE__ */ jsx132(TicketCheck, { className: "size-6", strokeWidth: 1.75 })
|
|
12660
12671
|
}
|
|
12661
12672
|
),
|
|
12662
|
-
/* @__PURE__ */
|
|
12663
|
-
/* @__PURE__ */
|
|
12664
|
-
/* @__PURE__ */
|
|
12673
|
+
/* @__PURE__ */ jsxs88("div", { children: [
|
|
12674
|
+
/* @__PURE__ */ jsx132("h2", { className: "text-[1.375rem] leading-tight font-semibold tracking-[-0.02em] text-foreground", children: "Find your booking" }),
|
|
12675
|
+
/* @__PURE__ */ jsx132("p", { className: "mt-1.5 text-[0.875rem] leading-relaxed text-muted-foreground", children: "Enter the booking number and PIN from your confirmation email." })
|
|
12665
12676
|
] })
|
|
12666
12677
|
] }),
|
|
12667
|
-
/* @__PURE__ */
|
|
12678
|
+
/* @__PURE__ */ jsx132(Form, { ...form, children: /* @__PURE__ */ jsxs88("form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-4", children: [
|
|
12668
12679
|
field("reservationNumber", "Booking number", TicketCheck, "e.g. 123456"),
|
|
12669
12680
|
field("bookingPin", "PIN", KeyRound2, "XXXXXX", { pin: true }),
|
|
12670
12681
|
error,
|
|
12671
|
-
/* @__PURE__ */
|
|
12672
|
-
/* @__PURE__ */
|
|
12682
|
+
/* @__PURE__ */ jsxs88(CtaButton, { type: "submit", className: "mt-1 h-12 w-full text-[0.9375rem]", disabled: form.formState.isSubmitting, children: [
|
|
12683
|
+
/* @__PURE__ */ jsx132(Search4, { className: "size-4", "aria-hidden": "true" }),
|
|
12673
12684
|
buttonText
|
|
12674
12685
|
] })
|
|
12675
12686
|
] }) })
|
|
@@ -12774,7 +12785,7 @@ function daysBetween(pickupIso, dropoffIso) {
|
|
|
12774
12785
|
}
|
|
12775
12786
|
|
|
12776
12787
|
// src/components/ManageBooking/BookingOverview.tsx
|
|
12777
|
-
import { Fragment as Fragment18, jsx as
|
|
12788
|
+
import { Fragment as Fragment18, jsx as jsx133, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
12778
12789
|
var STATUS_ICON = {
|
|
12779
12790
|
PENDING: Clock4,
|
|
12780
12791
|
PAYMENT_PENDING: Clock4,
|
|
@@ -12829,8 +12840,8 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12829
12840
|
const StatusIcon = STATUS_ICON[booking.status] ?? Info6;
|
|
12830
12841
|
const supplier = booking.supplierName ?? "the supplier";
|
|
12831
12842
|
const trackIndex = TRACK_INDEX[booking.status] ?? -1;
|
|
12832
|
-
return /* @__PURE__ */
|
|
12833
|
-
/* @__PURE__ */
|
|
12843
|
+
return /* @__PURE__ */ jsxs89("div", { className: "mx-auto flex max-w-[80rem] flex-col gap-6 py-2", children: [
|
|
12844
|
+
/* @__PURE__ */ jsxs89(
|
|
12834
12845
|
motion11.button,
|
|
12835
12846
|
{
|
|
12836
12847
|
type: "button",
|
|
@@ -12840,24 +12851,24 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12840
12851
|
transition: spring.snappy,
|
|
12841
12852
|
className: "fb-focus flex w-fit items-center gap-1.5 rounded-full px-1 text-[0.8125rem] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
12842
12853
|
children: [
|
|
12843
|
-
/* @__PURE__ */
|
|
12854
|
+
/* @__PURE__ */ jsx133(ArrowLeft3, { className: "size-4", "aria-hidden": "true" }),
|
|
12844
12855
|
"Look up a different booking"
|
|
12845
12856
|
]
|
|
12846
12857
|
}
|
|
12847
12858
|
),
|
|
12848
|
-
/* @__PURE__ */
|
|
12849
|
-
/* @__PURE__ */
|
|
12850
|
-
/* @__PURE__ */
|
|
12851
|
-
/* @__PURE__ */
|
|
12859
|
+
/* @__PURE__ */ jsxs89("header", { className: "flex flex-col gap-5 border-b border-border pb-7", children: [
|
|
12860
|
+
/* @__PURE__ */ jsxs89("div", { children: [
|
|
12861
|
+
/* @__PURE__ */ jsxs89("p", { className: "fb-eyebrow flex items-center gap-1.5 text-muted-foreground", children: [
|
|
12862
|
+
/* @__PURE__ */ jsx133(StatusIcon, { className: "size-3.5", "aria-hidden": "true" }),
|
|
12852
12863
|
booking.supplierName ?? "Your booking",
|
|
12853
|
-
booking.supplierRef ? /* @__PURE__ */
|
|
12864
|
+
booking.supplierRef ? /* @__PURE__ */ jsxs89("span", { className: "fb-tabular", children: [
|
|
12854
12865
|
" \xB7 ",
|
|
12855
12866
|
booking.supplierRef
|
|
12856
12867
|
] }) : null
|
|
12857
12868
|
] }),
|
|
12858
|
-
/* @__PURE__ */
|
|
12859
|
-
/* @__PURE__ */
|
|
12860
|
-
/* @__PURE__ */
|
|
12869
|
+
/* @__PURE__ */ jsxs89("div", { className: "mt-2 flex flex-wrap items-center gap-3", children: [
|
|
12870
|
+
/* @__PURE__ */ jsx133("h2", { className: "text-[1.75rem] leading-[1.1] font-semibold tracking-[-0.02em] text-foreground sm:text-[2.25rem]", children: statusProgressLabel(booking.status) }),
|
|
12871
|
+
/* @__PURE__ */ jsxs89(
|
|
12861
12872
|
"span",
|
|
12862
12873
|
{
|
|
12863
12874
|
className: cn(
|
|
@@ -12865,34 +12876,34 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12865
12876
|
STATUS_TONE[booking.status] ?? STATUS_TONE.PENDING
|
|
12866
12877
|
),
|
|
12867
12878
|
children: [
|
|
12868
|
-
/* @__PURE__ */
|
|
12879
|
+
/* @__PURE__ */ jsx133(StatusIcon, { className: "size-3.5", "aria-hidden": "true" }),
|
|
12869
12880
|
statusLabel(booking.status)
|
|
12870
12881
|
]
|
|
12871
12882
|
}
|
|
12872
12883
|
)
|
|
12873
12884
|
] }),
|
|
12874
|
-
/* @__PURE__ */
|
|
12885
|
+
/* @__PURE__ */ jsx133("p", { className: "mt-3 max-w-xl text-[0.9375rem] leading-relaxed text-muted-foreground", children: cancelled ? /* @__PURE__ */ jsx133(Fragment18, { children: "This trip won't go ahead \u2014 see the note below." }) : /* @__PURE__ */ jsxs89(Fragment18, { children: [
|
|
12875
12886
|
booking.supplierName ?? "Your supplier",
|
|
12876
12887
|
" is holding the",
|
|
12877
12888
|
" ",
|
|
12878
|
-
/* @__PURE__ */
|
|
12889
|
+
/* @__PURE__ */ jsx133("span", { className: "font-medium text-foreground", children: booking.vehicle.name || "car" }),
|
|
12879
12890
|
" for",
|
|
12880
12891
|
" ",
|
|
12881
|
-
/* @__PURE__ */
|
|
12892
|
+
/* @__PURE__ */ jsx133("span", { className: "font-medium text-foreground", children: renterName === "Renter" ? "you" : renterName }),
|
|
12882
12893
|
"."
|
|
12883
12894
|
] }) })
|
|
12884
12895
|
] }),
|
|
12885
|
-
trackIndex >= 0 && /* @__PURE__ */
|
|
12896
|
+
trackIndex >= 0 && /* @__PURE__ */ jsx133("ol", { className: "grid max-w-2xl grid-cols-4 gap-2", "aria-label": "Booking progress", children: TRACK_STEPS.map((label2, index) => {
|
|
12886
12897
|
const reached = index <= trackIndex;
|
|
12887
|
-
return /* @__PURE__ */
|
|
12888
|
-
/* @__PURE__ */
|
|
12898
|
+
return /* @__PURE__ */ jsxs89("li", { className: "flex flex-col gap-2", "aria-current": index === trackIndex ? "step" : void 0, children: [
|
|
12899
|
+
/* @__PURE__ */ jsx133(
|
|
12889
12900
|
"span",
|
|
12890
12901
|
{
|
|
12891
12902
|
"aria-hidden": "true",
|
|
12892
12903
|
className: cn("h-1.5 rounded-full", reached ? "bg-wizard-selected" : "bg-surface-2")
|
|
12893
12904
|
}
|
|
12894
12905
|
),
|
|
12895
|
-
/* @__PURE__ */
|
|
12906
|
+
/* @__PURE__ */ jsx133(
|
|
12896
12907
|
"span",
|
|
12897
12908
|
{
|
|
12898
12909
|
className: cn(
|
|
@@ -12905,26 +12916,26 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12905
12916
|
] }, label2);
|
|
12906
12917
|
}) })
|
|
12907
12918
|
] }),
|
|
12908
|
-
cancelled && /* @__PURE__ */
|
|
12919
|
+
cancelled && /* @__PURE__ */ jsxs89(
|
|
12909
12920
|
"div",
|
|
12910
12921
|
{
|
|
12911
12922
|
role: "status",
|
|
12912
12923
|
className: "flex items-start gap-3 rounded-2xl border border-destructive/30 bg-destructive/5 p-5 text-[0.875rem] leading-relaxed text-foreground",
|
|
12913
12924
|
children: [
|
|
12914
|
-
/* @__PURE__ */
|
|
12915
|
-
/* @__PURE__ */
|
|
12916
|
-
/* @__PURE__ */
|
|
12925
|
+
/* @__PURE__ */ jsx133(Ban, { className: "mt-0.5 size-4 shrink-0 text-destructive", "aria-hidden": "true" }),
|
|
12926
|
+
/* @__PURE__ */ jsxs89("div", { children: [
|
|
12927
|
+
/* @__PURE__ */ jsxs89("p", { className: "font-semibold", children: [
|
|
12917
12928
|
"Cancelled ",
|
|
12918
12929
|
formatDateTime(booking.cancelledAt)
|
|
12919
12930
|
] }),
|
|
12920
|
-
booking.cancellationReason && /* @__PURE__ */
|
|
12931
|
+
booking.cancellationReason && /* @__PURE__ */ jsx133("p", { className: "mt-1 text-muted-foreground", children: booking.cancellationReason })
|
|
12921
12932
|
] })
|
|
12922
12933
|
]
|
|
12923
12934
|
}
|
|
12924
12935
|
),
|
|
12925
|
-
/* @__PURE__ */
|
|
12926
|
-
/* @__PURE__ */
|
|
12927
|
-
/* @__PURE__ */
|
|
12936
|
+
/* @__PURE__ */ jsxs89("div", { className: "grid grid-cols-1 gap-6 lg:grid-cols-[1.6fr_1fr] lg:items-start", children: [
|
|
12937
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex flex-col gap-5", children: [
|
|
12938
|
+
/* @__PURE__ */ jsx133(
|
|
12928
12939
|
CompactVehicleCard,
|
|
12929
12940
|
{
|
|
12930
12941
|
image: booking.vehicle.image,
|
|
@@ -12933,7 +12944,7 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12933
12944
|
logoUrl: booking.vehicle.supplierLogo,
|
|
12934
12945
|
logoAlt: booking.supplierName ?? "",
|
|
12935
12946
|
specs: vehicleSpecs,
|
|
12936
|
-
footer: /* @__PURE__ */
|
|
12947
|
+
footer: /* @__PURE__ */ jsx133(
|
|
12937
12948
|
ReservationKeys,
|
|
12938
12949
|
{
|
|
12939
12950
|
supplierName: supplier,
|
|
@@ -12943,7 +12954,7 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12943
12954
|
)
|
|
12944
12955
|
}
|
|
12945
12956
|
),
|
|
12946
|
-
/* @__PURE__ */
|
|
12957
|
+
/* @__PURE__ */ jsx133(
|
|
12947
12958
|
RentalWindow,
|
|
12948
12959
|
{
|
|
12949
12960
|
pickupLocation: booking.pickupLocation || "Any location",
|
|
@@ -12956,11 +12967,11 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12956
12967
|
datesMissing
|
|
12957
12968
|
}
|
|
12958
12969
|
),
|
|
12959
|
-
booking.extras.length > 0 && /* @__PURE__ */
|
|
12960
|
-
/* @__PURE__ */
|
|
12961
|
-
extra.unitPrice != null && /* @__PURE__ */
|
|
12970
|
+
booking.extras.length > 0 && /* @__PURE__ */ jsx133(InfoCard, { icon: PackagePlus2, title: "Add-ons on this booking", children: /* @__PURE__ */ jsx133("ul", { className: "flex flex-col gap-2", children: booking.extras.map((extra) => /* @__PURE__ */ jsxs89("li", { className: "flex items-start justify-between gap-4", children: [
|
|
12971
|
+
/* @__PURE__ */ jsx133("span", { className: "min-w-0 text-[0.875rem] text-foreground", children: extra.quantity > 1 ? `${extra.name} \xD7 ${extra.quantity}` : extra.name }),
|
|
12972
|
+
extra.unitPrice != null && /* @__PURE__ */ jsx133("span", { className: "fb-tabular shrink-0 text-[0.875rem] font-medium text-foreground", children: formatZAR(extra.unitPrice * extra.quantity) })
|
|
12962
12973
|
] }, extra.code)) }) }),
|
|
12963
|
-
/* @__PURE__ */
|
|
12974
|
+
/* @__PURE__ */ jsx133(InfoCard, { icon: User2, title: "Renter on the booking", children: /* @__PURE__ */ jsx133(
|
|
12964
12975
|
DriverSummary,
|
|
12965
12976
|
{
|
|
12966
12977
|
name: renterName,
|
|
@@ -12969,48 +12980,48 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
12969
12980
|
fields: driverFields
|
|
12970
12981
|
}
|
|
12971
12982
|
) }),
|
|
12972
|
-
booking.notes && /* @__PURE__ */
|
|
12983
|
+
booking.notes && /* @__PURE__ */ jsx133(InfoCard, { icon: FileText5, title: `Notes sent to ${booking.supplierName ?? "the supplier"}`, children: /* @__PURE__ */ jsx133("p", { className: "text-[0.875rem] leading-relaxed whitespace-pre-line text-muted-foreground", children: booking.notes }) })
|
|
12973
12984
|
] }),
|
|
12974
|
-
/* @__PURE__ */
|
|
12975
|
-
/* @__PURE__ */
|
|
12985
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex flex-col gap-5 lg:sticky lg:top-0", children: [
|
|
12986
|
+
/* @__PURE__ */ jsxs89(
|
|
12976
12987
|
"section",
|
|
12977
12988
|
{
|
|
12978
12989
|
"aria-label": "Price",
|
|
12979
12990
|
className: "overflow-hidden rounded-2xl border border-border bg-card shadow-panel",
|
|
12980
12991
|
children: [
|
|
12981
|
-
booking.extras.length > 0 && /* @__PURE__ */
|
|
12982
|
-
/* @__PURE__ */
|
|
12983
|
-
/* @__PURE__ */
|
|
12984
|
-
/* @__PURE__ */
|
|
12992
|
+
booking.extras.length > 0 && /* @__PURE__ */ jsxs89("dl", { className: "flex flex-col gap-2.5 p-5", children: [
|
|
12993
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex items-start justify-between gap-4", children: [
|
|
12994
|
+
/* @__PURE__ */ jsx133("dt", { className: "text-[0.875rem] text-foreground", children: "Rental" }),
|
|
12995
|
+
/* @__PURE__ */ jsx133("dd", { className: "fb-tabular shrink-0 text-[0.875rem] font-medium text-foreground", children: formatZAR(baseAmount) })
|
|
12985
12996
|
] }),
|
|
12986
|
-
booking.extras.map((extra) => /* @__PURE__ */
|
|
12987
|
-
/* @__PURE__ */
|
|
12988
|
-
/* @__PURE__ */
|
|
12997
|
+
booking.extras.map((extra) => /* @__PURE__ */ jsxs89("div", { className: "flex items-start justify-between gap-4", children: [
|
|
12998
|
+
/* @__PURE__ */ jsx133("dt", { className: "min-w-0 text-[0.875rem] text-foreground", children: extra.quantity > 1 ? `${extra.name} \xD7 ${extra.quantity}` : extra.name }),
|
|
12999
|
+
/* @__PURE__ */ jsx133("dd", { className: "fb-tabular shrink-0 text-[0.875rem] font-medium text-foreground", children: extra.unitPrice != null ? formatZAR(extra.unitPrice * extra.quantity) : "\u2014" })
|
|
12989
13000
|
] }, extra.code))
|
|
12990
13001
|
] }),
|
|
12991
|
-
/* @__PURE__ */
|
|
12992
|
-
/* @__PURE__ */
|
|
13002
|
+
/* @__PURE__ */ jsx133("div", { className: cn("bg-surface-2 px-5 py-4", booking.extras.length > 0 && "border-t border-border"), children: /* @__PURE__ */ jsxs89("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
13003
|
+
/* @__PURE__ */ jsxs89("span", { className: "text-[0.875rem] font-semibold text-foreground", children: [
|
|
12993
13004
|
"Total",
|
|
12994
|
-
days > 0 && /* @__PURE__ */
|
|
13005
|
+
days > 0 && /* @__PURE__ */ jsxs89("span", { className: "ml-1.5 font-normal text-muted-foreground", children: [
|
|
12995
13006
|
"\xB7 ",
|
|
12996
13007
|
days,
|
|
12997
13008
|
" ",
|
|
12998
13009
|
days === 1 ? "day" : "days"
|
|
12999
13010
|
] })
|
|
13000
13011
|
] }),
|
|
13001
|
-
/* @__PURE__ */
|
|
13012
|
+
/* @__PURE__ */ jsx133("span", { className: "fb-tabular text-[1.5rem] font-bold tracking-[-0.03em] text-foreground", children: formatZAR(booking.totalPrice) })
|
|
13002
13013
|
] }) })
|
|
13003
13014
|
]
|
|
13004
13015
|
}
|
|
13005
13016
|
),
|
|
13006
|
-
/* @__PURE__ */
|
|
13007
|
-
/* @__PURE__ */
|
|
13008
|
-
/* @__PURE__ */
|
|
13009
|
-
/* @__PURE__ */
|
|
13010
|
-
/* @__PURE__ */
|
|
13017
|
+
/* @__PURE__ */ jsxs89("section", { "aria-label": "Manage this booking", className: "rounded-2xl border border-border bg-card p-5 shadow-panel", children: [
|
|
13018
|
+
/* @__PURE__ */ jsx133("h3", { className: "mb-3.5 text-[0.9375rem] font-semibold text-foreground", children: "Manage this booking" }),
|
|
13019
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex flex-col gap-2", children: [
|
|
13020
|
+
/* @__PURE__ */ jsxs89(CtaButton, { type: "button", onClick: onReceipt, className: "h-11 w-full", children: [
|
|
13021
|
+
/* @__PURE__ */ jsx133(Printer, { className: "size-4", "aria-hidden": "true" }),
|
|
13011
13022
|
"Print receipt"
|
|
13012
13023
|
] }),
|
|
13013
|
-
booking.canAmend && /* @__PURE__ */
|
|
13024
|
+
booking.canAmend && /* @__PURE__ */ jsxs89(
|
|
13014
13025
|
motion11.button,
|
|
13015
13026
|
{
|
|
13016
13027
|
type: "button",
|
|
@@ -13019,12 +13030,12 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
13019
13030
|
transition: spring.snappy,
|
|
13020
13031
|
className: "fb-focus flex h-11 w-full items-center justify-center gap-2 rounded-xl border border-border bg-card text-[0.875rem] font-semibold text-foreground transition-colors hover:border-border-strong hover:bg-surface-2",
|
|
13021
13032
|
children: [
|
|
13022
|
-
/* @__PURE__ */
|
|
13033
|
+
/* @__PURE__ */ jsx133(CalendarClock, { className: "size-4", "aria-hidden": "true" }),
|
|
13023
13034
|
"Change dates or car"
|
|
13024
13035
|
]
|
|
13025
13036
|
}
|
|
13026
13037
|
),
|
|
13027
|
-
booking.canCancel && /* @__PURE__ */
|
|
13038
|
+
booking.canCancel && /* @__PURE__ */ jsxs89(
|
|
13028
13039
|
motion11.button,
|
|
13029
13040
|
{
|
|
13030
13041
|
type: "button",
|
|
@@ -13033,32 +13044,32 @@ function BookingOverview({ booking, bookingPin, onCancel, onAmend, onReceipt, on
|
|
|
13033
13044
|
transition: spring.snappy,
|
|
13034
13045
|
className: "fb-focus flex h-11 w-full items-center justify-center gap-2 rounded-xl border border-destructive/30 bg-card text-[0.875rem] font-semibold text-destructive transition-colors hover:bg-destructive/5",
|
|
13035
13046
|
children: [
|
|
13036
|
-
/* @__PURE__ */
|
|
13047
|
+
/* @__PURE__ */ jsx133(Ban, { className: "size-4", "aria-hidden": "true" }),
|
|
13037
13048
|
"Cancel booking"
|
|
13038
13049
|
]
|
|
13039
13050
|
}
|
|
13040
13051
|
)
|
|
13041
13052
|
] })
|
|
13042
13053
|
] }),
|
|
13043
|
-
/* @__PURE__ */
|
|
13044
|
-
/* @__PURE__ */
|
|
13054
|
+
/* @__PURE__ */ jsx133(InfoCard, { icon: IdCard4, title: "Bring this to the counter", tone: "muted", children: /* @__PURE__ */ jsxs89("ul", { className: "flex list-disc flex-col gap-1.5 pl-5 text-[0.8125rem] leading-relaxed text-muted-foreground marker:text-border-strong", children: [
|
|
13055
|
+
/* @__PURE__ */ jsxs89("li", { children: [
|
|
13045
13056
|
"The driving licence and ID or passport for",
|
|
13046
13057
|
" ",
|
|
13047
|
-
/* @__PURE__ */
|
|
13058
|
+
/* @__PURE__ */ jsx133("span", { className: "font-medium text-foreground", children: renterName === "Renter" ? "the renter" : renterName }),
|
|
13048
13059
|
", matching the details above."
|
|
13049
13060
|
] }),
|
|
13050
|
-
/* @__PURE__ */
|
|
13051
|
-
/* @__PURE__ */
|
|
13061
|
+
/* @__PURE__ */ jsx133("li", { children: "A valid credit card in the renter's own name for any deposit the supplier requires." }),
|
|
13062
|
+
/* @__PURE__ */ jsxs89("li", { children: [
|
|
13052
13063
|
"The booking number",
|
|
13053
13064
|
" ",
|
|
13054
|
-
/* @__PURE__ */
|
|
13065
|
+
/* @__PURE__ */ jsx133("span", { className: "fb-tabular font-medium text-foreground", children: booking.supplierRef }),
|
|
13055
13066
|
"."
|
|
13056
13067
|
] })
|
|
13057
13068
|
] }) }),
|
|
13058
|
-
/* @__PURE__ */
|
|
13069
|
+
/* @__PURE__ */ jsx133(InfoCard, { icon: Info6, title: "Need help?", tone: "muted", children: /* @__PURE__ */ jsxs89("p", { className: "text-[0.8125rem] leading-relaxed text-muted-foreground", children: [
|
|
13059
13070
|
"Contact us with your PIN",
|
|
13060
13071
|
" ",
|
|
13061
|
-
/* @__PURE__ */
|
|
13072
|
+
/* @__PURE__ */ jsx133("span", { className: "fb-tabular font-medium text-foreground", children: bookingPin }),
|
|
13062
13073
|
" ",
|
|
13063
13074
|
"and we'll handle it with ",
|
|
13064
13075
|
booking.supplierName ?? "the supplier",
|
|
@@ -13084,7 +13095,7 @@ import {
|
|
|
13084
13095
|
User as User3,
|
|
13085
13096
|
Users as Users8
|
|
13086
13097
|
} from "lucide-react";
|
|
13087
|
-
import { Fragment as Fragment19, jsx as
|
|
13098
|
+
import { Fragment as Fragment19, jsx as jsx134, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
13088
13099
|
function QuoteReview({ quote, booking, onBook }) {
|
|
13089
13100
|
const [, setNow] = useState21(() => Date.now());
|
|
13090
13101
|
useEffect21(() => {
|
|
@@ -13107,41 +13118,41 @@ function QuoteReview({ quote, booking, onBook }) {
|
|
|
13107
13118
|
const days = quote.rentalDays ?? daysBetween(quote.pickupDate, quote.dropoffDate);
|
|
13108
13119
|
const datesMissing = !quote.pickupDate || !quote.dropoffDate;
|
|
13109
13120
|
const lines = quote.priceBreakdown.filter((line) => line.label);
|
|
13110
|
-
return /* @__PURE__ */
|
|
13111
|
-
/* @__PURE__ */
|
|
13112
|
-
/* @__PURE__ */
|
|
13121
|
+
return /* @__PURE__ */ jsxs90("div", { className: "mx-auto flex max-w-[80rem] flex-col gap-6 py-2", children: [
|
|
13122
|
+
/* @__PURE__ */ jsxs90("header", { className: "flex flex-col gap-3 border-b border-border pb-7", children: [
|
|
13123
|
+
/* @__PURE__ */ jsxs90("p", { className: "fb-eyebrow text-muted-foreground", children: [
|
|
13113
13124
|
"Quote \xB7 ",
|
|
13114
13125
|
quote.quoteRef,
|
|
13115
13126
|
quote.supplierName ? ` \xB7 ${quote.supplierName}` : ""
|
|
13116
13127
|
] }),
|
|
13117
|
-
/* @__PURE__ */
|
|
13118
|
-
/* @__PURE__ */
|
|
13128
|
+
/* @__PURE__ */ jsx134("h2", { className: "text-[2rem] leading-[1.05] font-semibold tracking-[-0.02em] text-foreground sm:text-[2.75rem]", children: "Review your quote" }),
|
|
13129
|
+
/* @__PURE__ */ jsxs90("p", { className: "max-w-lg text-[0.9375rem] leading-relaxed text-muted-foreground", children: [
|
|
13119
13130
|
quote.supplierName ?? "The supplier",
|
|
13120
13131
|
" is holding the",
|
|
13121
13132
|
" ",
|
|
13122
|
-
/* @__PURE__ */
|
|
13133
|
+
/* @__PURE__ */ jsx134("span", { className: "font-medium text-foreground", children: quote.vehicle.name || "car" }),
|
|
13123
13134
|
" at this price until you book. Nothing is reserved until you confirm below."
|
|
13124
13135
|
] }),
|
|
13125
|
-
expired ? /* @__PURE__ */
|
|
13136
|
+
expired ? /* @__PURE__ */ jsxs90(
|
|
13126
13137
|
"p",
|
|
13127
13138
|
{
|
|
13128
13139
|
role: "alert",
|
|
13129
13140
|
className: "flex w-fit items-center gap-2 rounded-full border border-destructive/30 bg-destructive/5 px-3.5 py-1.5 text-[0.8125rem] font-medium text-foreground",
|
|
13130
13141
|
children: [
|
|
13131
|
-
/* @__PURE__ */
|
|
13142
|
+
/* @__PURE__ */ jsx134(CircleAlert5, { className: "size-4 text-destructive", "aria-hidden": "true" }),
|
|
13132
13143
|
"This quote has expired. Search again for current pricing."
|
|
13133
13144
|
]
|
|
13134
13145
|
}
|
|
13135
|
-
) : quote.expiresAt ? /* @__PURE__ */
|
|
13136
|
-
/* @__PURE__ */
|
|
13146
|
+
) : quote.expiresAt ? /* @__PURE__ */ jsxs90("p", { className: "flex w-fit items-center gap-2 rounded-full border border-border bg-surface-2 px-3.5 py-1.5 text-[0.8125rem] text-muted-foreground", children: [
|
|
13147
|
+
/* @__PURE__ */ jsx134(Clock5, { className: "size-4", "aria-hidden": "true" }),
|
|
13137
13148
|
"Held until",
|
|
13138
13149
|
" ",
|
|
13139
|
-
/* @__PURE__ */
|
|
13150
|
+
/* @__PURE__ */ jsx134("span", { className: "font-medium text-foreground", children: formatInstant(quote.expiresAt) })
|
|
13140
13151
|
] }) : null
|
|
13141
13152
|
] }),
|
|
13142
|
-
/* @__PURE__ */
|
|
13143
|
-
/* @__PURE__ */
|
|
13144
|
-
/* @__PURE__ */
|
|
13153
|
+
/* @__PURE__ */ jsxs90("div", { className: "grid grid-cols-1 gap-6 lg:grid-cols-[1.6fr_1fr] lg:items-start", children: [
|
|
13154
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex flex-col gap-5", children: [
|
|
13155
|
+
/* @__PURE__ */ jsx134(
|
|
13145
13156
|
CompactVehicleCard,
|
|
13146
13157
|
{
|
|
13147
13158
|
image: quote.vehicle.image,
|
|
@@ -13150,7 +13161,7 @@ function QuoteReview({ quote, booking, onBook }) {
|
|
|
13150
13161
|
specs: vehicleSpecs
|
|
13151
13162
|
}
|
|
13152
13163
|
),
|
|
13153
|
-
/* @__PURE__ */
|
|
13164
|
+
/* @__PURE__ */ jsx134(
|
|
13154
13165
|
RentalWindow,
|
|
13155
13166
|
{
|
|
13156
13167
|
pickupLocation: quote.pickupLocation || "Any location",
|
|
@@ -13163,11 +13174,11 @@ function QuoteReview({ quote, booking, onBook }) {
|
|
|
13163
13174
|
datesMissing
|
|
13164
13175
|
}
|
|
13165
13176
|
),
|
|
13166
|
-
quote.extras.length > 0 && /* @__PURE__ */
|
|
13167
|
-
/* @__PURE__ */
|
|
13168
|
-
extra.unitPrice != null && /* @__PURE__ */
|
|
13177
|
+
quote.extras.length > 0 && /* @__PURE__ */ jsx134(InfoCard, { icon: PackagePlus3, title: "Add-ons on this quote", children: /* @__PURE__ */ jsx134("ul", { className: "flex flex-col gap-1.5", children: quote.extras.map((extra) => /* @__PURE__ */ jsxs90("li", { className: "flex items-start justify-between gap-4", children: [
|
|
13178
|
+
/* @__PURE__ */ jsx134("span", { className: "min-w-0 text-[0.8125rem] text-foreground", children: extra.quantity > 1 ? `${extra.name} \xD7 ${extra.quantity}` : extra.name }),
|
|
13179
|
+
extra.unitPrice != null && /* @__PURE__ */ jsx134("span", { className: "fb-tabular shrink-0 text-[0.8125rem] font-medium text-foreground", children: formatZAR(extra.unitPrice * extra.quantity) })
|
|
13169
13180
|
] }, extra.code || extra.name)) }) }),
|
|
13170
|
-
/* @__PURE__ */
|
|
13181
|
+
/* @__PURE__ */ jsx134(InfoCard, { icon: User3, title: "Renter on the quote", children: /* @__PURE__ */ jsx134(
|
|
13171
13182
|
DriverSummary,
|
|
13172
13183
|
{
|
|
13173
13184
|
name: renterName,
|
|
@@ -13176,34 +13187,34 @@ function QuoteReview({ quote, booking, onBook }) {
|
|
|
13176
13187
|
fields: driverFields
|
|
13177
13188
|
}
|
|
13178
13189
|
) }),
|
|
13179
|
-
quote.notes && /* @__PURE__ */
|
|
13190
|
+
quote.notes && /* @__PURE__ */ jsx134(InfoCard, { icon: FileText6, title: `Notes for ${quote.supplierName ?? "the supplier"}`, children: /* @__PURE__ */ jsx134("p", { className: "text-[0.8125rem] leading-relaxed whitespace-pre-line text-muted-foreground", children: quote.notes }) })
|
|
13180
13191
|
] }),
|
|
13181
|
-
/* @__PURE__ */
|
|
13182
|
-
/* @__PURE__ */
|
|
13183
|
-
lines.length > 0 && /* @__PURE__ */
|
|
13184
|
-
/* @__PURE__ */
|
|
13185
|
-
/* @__PURE__ */
|
|
13192
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex flex-col gap-5 lg:sticky lg:top-0", children: [
|
|
13193
|
+
/* @__PURE__ */ jsxs90("section", { "aria-label": "Price", className: "overflow-hidden rounded-2xl border border-border bg-card shadow-panel", children: [
|
|
13194
|
+
lines.length > 0 && /* @__PURE__ */ jsx134("dl", { className: "flex flex-col gap-2.5 p-5", children: lines.map((line) => /* @__PURE__ */ jsxs90("div", { className: "flex items-start justify-between gap-4", children: [
|
|
13195
|
+
/* @__PURE__ */ jsx134("dt", { className: "min-w-0 text-[0.8125rem] text-foreground", children: line.label }),
|
|
13196
|
+
/* @__PURE__ */ jsx134("dd", { className: "fb-tabular shrink-0 text-[0.8125rem] font-medium text-foreground", children: formatZAR(line.amount) })
|
|
13186
13197
|
] }, line.label)) }),
|
|
13187
|
-
/* @__PURE__ */
|
|
13188
|
-
/* @__PURE__ */
|
|
13189
|
-
/* @__PURE__ */
|
|
13198
|
+
/* @__PURE__ */ jsxs90("div", { className: `bg-surface-2 px-5 py-4 ${lines.length > 0 ? "border-t border-border" : ""}`, children: [
|
|
13199
|
+
/* @__PURE__ */ jsxs90("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
13200
|
+
/* @__PURE__ */ jsxs90("span", { className: "text-[0.8125rem] font-semibold text-foreground", children: [
|
|
13190
13201
|
"Total",
|
|
13191
|
-
days > 0 && /* @__PURE__ */
|
|
13202
|
+
days > 0 && /* @__PURE__ */ jsxs90("span", { className: "ml-1.5 font-normal text-muted-foreground", children: [
|
|
13192
13203
|
"\xB7 ",
|
|
13193
13204
|
days,
|
|
13194
13205
|
" ",
|
|
13195
13206
|
days === 1 ? "day" : "days"
|
|
13196
13207
|
] })
|
|
13197
13208
|
] }),
|
|
13198
|
-
/* @__PURE__ */
|
|
13209
|
+
/* @__PURE__ */ jsx134("span", { className: "fb-tabular text-[1.5rem] font-bold tracking-[-0.03em] text-foreground", children: formatZAR(quote.totalPrice) })
|
|
13199
13210
|
] }),
|
|
13200
|
-
quote.deposit != null && quote.deposit > 0 && /* @__PURE__ */
|
|
13201
|
-
/* @__PURE__ */
|
|
13202
|
-
/* @__PURE__ */
|
|
13211
|
+
quote.deposit != null && quote.deposit > 0 && /* @__PURE__ */ jsxs90("div", { className: "mt-2 flex items-baseline justify-between gap-4 border-t border-border/60 pt-2", children: [
|
|
13212
|
+
/* @__PURE__ */ jsx134("span", { className: "text-[0.75rem] text-muted-foreground", children: "Deposit needed (refundable)" }),
|
|
13213
|
+
/* @__PURE__ */ jsx134("span", { className: "fb-tabular text-[0.8125rem] font-medium text-foreground", children: formatZAR(quote.deposit) })
|
|
13203
13214
|
] })
|
|
13204
13215
|
] })
|
|
13205
13216
|
] }),
|
|
13206
|
-
/* @__PURE__ */
|
|
13217
|
+
/* @__PURE__ */ jsx134(
|
|
13207
13218
|
Button,
|
|
13208
13219
|
{
|
|
13209
13220
|
type: "button",
|
|
@@ -13211,12 +13222,12 @@ function QuoteReview({ quote, booking, onBook }) {
|
|
|
13211
13222
|
className: "fb-focus h-12 w-full gap-2 rounded-xl bg-car-cta text-[0.9375rem] font-semibold text-car-cta-fg shadow-sm transition-[background-color,transform] duration-150 hover:bg-car-cta/90 active:scale-[0.99]",
|
|
13212
13223
|
onClick: onBook,
|
|
13213
13224
|
disabled: booking || expired,
|
|
13214
|
-
children: booking ? /* @__PURE__ */
|
|
13215
|
-
/* @__PURE__ */
|
|
13225
|
+
children: booking ? /* @__PURE__ */ jsxs90(Fragment19, { children: [
|
|
13226
|
+
/* @__PURE__ */ jsx134(LoaderCircle5, { className: "size-3.5 animate-spin" }),
|
|
13216
13227
|
"Booking"
|
|
13217
|
-
] }) : /* @__PURE__ */
|
|
13228
|
+
] }) : /* @__PURE__ */ jsxs90(Fragment19, { children: [
|
|
13218
13229
|
"Book now",
|
|
13219
|
-
/* @__PURE__ */
|
|
13230
|
+
/* @__PURE__ */ jsx134(ArrowRight8, { "data-icon": "inline-end", className: "size-3.5", "aria-hidden": "true" })
|
|
13220
13231
|
] })
|
|
13221
13232
|
}
|
|
13222
13233
|
)
|
|
@@ -13230,7 +13241,7 @@ import { useForm as useForm2 } from "react-hook-form";
|
|
|
13230
13241
|
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
|
13231
13242
|
import { z as z2 } from "zod";
|
|
13232
13243
|
import { Ban as Ban2 } from "lucide-react";
|
|
13233
|
-
import { jsx as
|
|
13244
|
+
import { jsx as jsx135, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
13234
13245
|
var cancelSchema = z2.object({
|
|
13235
13246
|
reason: z2.string().trim().max(500, "Keep the reason under 500 characters").optional()
|
|
13236
13247
|
});
|
|
@@ -13248,7 +13259,7 @@ function CancelDialog({ reservationNumber, bookingPin, open, onOpenChange, onCan
|
|
|
13248
13259
|
onCancelled(result.data.booking);
|
|
13249
13260
|
onOpenChange(false);
|
|
13250
13261
|
};
|
|
13251
|
-
return /* @__PURE__ */
|
|
13262
|
+
return /* @__PURE__ */ jsx135(
|
|
13252
13263
|
AlertDialog,
|
|
13253
13264
|
{
|
|
13254
13265
|
open,
|
|
@@ -13256,27 +13267,27 @@ function CancelDialog({ reservationNumber, bookingPin, open, onOpenChange, onCan
|
|
|
13256
13267
|
if (next) form.reset();
|
|
13257
13268
|
onOpenChange(next);
|
|
13258
13269
|
},
|
|
13259
|
-
children: /* @__PURE__ */
|
|
13260
|
-
/* @__PURE__ */
|
|
13261
|
-
/* @__PURE__ */
|
|
13270
|
+
children: /* @__PURE__ */ jsxs91(AlertDialogContent, { className: "rounded-2xl p-6 sm:max-w-md", children: [
|
|
13271
|
+
/* @__PURE__ */ jsxs91(AlertDialogHeader, { children: [
|
|
13272
|
+
/* @__PURE__ */ jsx135(
|
|
13262
13273
|
"span",
|
|
13263
13274
|
{
|
|
13264
13275
|
"aria-hidden": "true",
|
|
13265
13276
|
className: "mb-1 grid size-12 place-items-center rounded-full bg-destructive/10 text-destructive",
|
|
13266
|
-
children: /* @__PURE__ */
|
|
13277
|
+
children: /* @__PURE__ */ jsx135(Ban2, { className: "size-5" })
|
|
13267
13278
|
}
|
|
13268
13279
|
),
|
|
13269
|
-
/* @__PURE__ */
|
|
13270
|
-
/* @__PURE__ */
|
|
13280
|
+
/* @__PURE__ */ jsx135(AlertDialogTitle, { className: "text-lg", children: "Cancel this booking?" }),
|
|
13281
|
+
/* @__PURE__ */ jsx135(AlertDialogDescription, { className: "text-[0.875rem] leading-relaxed", children: "This sends the cancellation to the supplier right away and can't be undone here." })
|
|
13271
13282
|
] }),
|
|
13272
|
-
/* @__PURE__ */
|
|
13273
|
-
/* @__PURE__ */
|
|
13283
|
+
/* @__PURE__ */ jsx135(Form, { ...form, children: /* @__PURE__ */ jsxs91("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
|
|
13284
|
+
/* @__PURE__ */ jsx135(
|
|
13274
13285
|
FormField,
|
|
13275
13286
|
{
|
|
13276
13287
|
control: form.control,
|
|
13277
13288
|
name: "reason",
|
|
13278
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
13279
|
-
/* @__PURE__ */
|
|
13289
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs91(FormItem, { children: [
|
|
13290
|
+
/* @__PURE__ */ jsx135(FormControl, { children: /* @__PURE__ */ jsx135(
|
|
13280
13291
|
Textarea,
|
|
13281
13292
|
{
|
|
13282
13293
|
placeholder: "Reason (optional)",
|
|
@@ -13287,14 +13298,14 @@ function CancelDialog({ reservationNumber, bookingPin, open, onOpenChange, onCan
|
|
|
13287
13298
|
...field
|
|
13288
13299
|
}
|
|
13289
13300
|
) }),
|
|
13290
|
-
/* @__PURE__ */
|
|
13301
|
+
/* @__PURE__ */ jsx135(FormMessage, {})
|
|
13291
13302
|
] })
|
|
13292
13303
|
}
|
|
13293
13304
|
),
|
|
13294
|
-
form.formState.errors.root && /* @__PURE__ */
|
|
13295
|
-
/* @__PURE__ */
|
|
13296
|
-
/* @__PURE__ */
|
|
13297
|
-
/* @__PURE__ */
|
|
13305
|
+
form.formState.errors.root && /* @__PURE__ */ jsx135(Notice, { tone: "error", children: form.formState.errors.root.message }),
|
|
13306
|
+
/* @__PURE__ */ jsxs91(AlertDialogFooter, { children: [
|
|
13307
|
+
/* @__PURE__ */ jsx135(AlertDialogCancel, { type: "button", disabled: form.formState.isSubmitting, children: "Keep booking" }),
|
|
13308
|
+
/* @__PURE__ */ jsx135(
|
|
13298
13309
|
AlertDialogAction,
|
|
13299
13310
|
{
|
|
13300
13311
|
type: "button",
|
|
@@ -13318,7 +13329,7 @@ function CancelDialog({ reservationNumber, bookingPin, open, onOpenChange, onCan
|
|
|
13318
13329
|
import { useMemo as useMemo15, useRef as useRef13, useState as useState22 } from "react";
|
|
13319
13330
|
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
13320
13331
|
import { ArrowLeft as ArrowLeft4 } from "lucide-react";
|
|
13321
|
-
import { jsx as
|
|
13332
|
+
import { jsx as jsx136, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
13322
13333
|
function criteriaFromBooking(booking) {
|
|
13323
13334
|
const pickup = splitIso(booking.pickupDate);
|
|
13324
13335
|
const dropoff = splitIso(booking.dropoffDate);
|
|
@@ -13384,13 +13395,13 @@ function AmendFlow({
|
|
|
13384
13395
|
onCancel();
|
|
13385
13396
|
};
|
|
13386
13397
|
if (!lockedSupplier) {
|
|
13387
|
-
return /* @__PURE__ */
|
|
13388
|
-
/* @__PURE__ */
|
|
13398
|
+
return /* @__PURE__ */ jsxs92("div", { className: "fb-card mx-auto max-w-md space-y-4 px-6 py-10 text-center", children: [
|
|
13399
|
+
/* @__PURE__ */ jsxs92("p", { className: "text-[0.9375rem] leading-relaxed text-muted-foreground", children: [
|
|
13389
13400
|
"This booking can't be amended online. Please contact us and quote ",
|
|
13390
13401
|
reservationNumber,
|
|
13391
13402
|
"."
|
|
13392
13403
|
] }),
|
|
13393
|
-
/* @__PURE__ */
|
|
13404
|
+
/* @__PURE__ */ jsx136(
|
|
13394
13405
|
"button",
|
|
13395
13406
|
{
|
|
13396
13407
|
type: "button",
|
|
@@ -13402,28 +13413,28 @@ function AmendFlow({
|
|
|
13402
13413
|
] });
|
|
13403
13414
|
}
|
|
13404
13415
|
if (!searching) {
|
|
13405
|
-
return /* @__PURE__ */
|
|
13406
|
-
/* @__PURE__ */
|
|
13416
|
+
return /* @__PURE__ */ jsxs92("div", { className: "mx-auto max-w-[80rem] space-y-5 py-2", children: [
|
|
13417
|
+
/* @__PURE__ */ jsxs92(
|
|
13407
13418
|
"button",
|
|
13408
13419
|
{
|
|
13409
13420
|
type: "button",
|
|
13410
13421
|
onClick: backToOverview,
|
|
13411
13422
|
className: "fb-focus flex w-fit items-center gap-1.5 rounded-full px-1 text-[0.8125rem] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
13412
13423
|
children: [
|
|
13413
|
-
/* @__PURE__ */
|
|
13424
|
+
/* @__PURE__ */ jsx136(ArrowLeft4, { className: "size-3.5" }),
|
|
13414
13425
|
"Back to booking"
|
|
13415
13426
|
]
|
|
13416
13427
|
}
|
|
13417
13428
|
),
|
|
13418
|
-
/* @__PURE__ */
|
|
13419
|
-
/* @__PURE__ */
|
|
13420
|
-
/* @__PURE__ */
|
|
13429
|
+
/* @__PURE__ */ jsxs92("div", { children: [
|
|
13430
|
+
/* @__PURE__ */ jsx136("h2", { className: "text-[1.5rem] leading-tight font-semibold tracking-[-0.02em] text-foreground", children: "Change your booking" }),
|
|
13431
|
+
/* @__PURE__ */ jsxs92("p", { className: "mt-1.5 text-[0.875rem] text-muted-foreground", children: [
|
|
13421
13432
|
"Pick new dates or places. Only ",
|
|
13422
13433
|
supplier,
|
|
13423
13434
|
" cars will show, so the booking stays with them."
|
|
13424
13435
|
] })
|
|
13425
13436
|
] }),
|
|
13426
|
-
/* @__PURE__ */
|
|
13437
|
+
/* @__PURE__ */ jsx136("div", { className: "@container fb-card p-3 sm:p-4", children: /* @__PURE__ */ jsx136(
|
|
13427
13438
|
SearchPanel,
|
|
13428
13439
|
{
|
|
13429
13440
|
initialCriteria: lastCriteria,
|
|
@@ -13438,9 +13449,9 @@ function AmendFlow({
|
|
|
13438
13449
|
) })
|
|
13439
13450
|
] });
|
|
13440
13451
|
}
|
|
13441
|
-
return /* @__PURE__ */
|
|
13442
|
-
/* @__PURE__ */
|
|
13443
|
-
/* @__PURE__ */
|
|
13452
|
+
return /* @__PURE__ */ jsxs92("div", { className: "mx-auto max-w-[80rem] space-y-5 py-2", children: [
|
|
13453
|
+
/* @__PURE__ */ jsxs92("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
13454
|
+
/* @__PURE__ */ jsxs92(
|
|
13444
13455
|
"button",
|
|
13445
13456
|
{
|
|
13446
13457
|
type: "button",
|
|
@@ -13450,22 +13461,22 @@ function AmendFlow({
|
|
|
13450
13461
|
},
|
|
13451
13462
|
className: "fb-focus flex w-fit items-center gap-1.5 rounded-full px-1 text-[0.8125rem] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
13452
13463
|
children: [
|
|
13453
|
-
/* @__PURE__ */
|
|
13464
|
+
/* @__PURE__ */ jsx136(ArrowLeft4, { className: "size-3.5" }),
|
|
13454
13465
|
"Change search"
|
|
13455
13466
|
]
|
|
13456
13467
|
}
|
|
13457
13468
|
),
|
|
13458
|
-
/* @__PURE__ */
|
|
13469
|
+
/* @__PURE__ */ jsxs92("p", { className: "fb-tabular rounded-full border border-border bg-surface-2 px-3 py-1 text-[0.75rem] font-medium text-foreground", children: [
|
|
13459
13470
|
supplier,
|
|
13460
13471
|
" \xB7 ",
|
|
13461
13472
|
reservationNumber
|
|
13462
13473
|
] })
|
|
13463
13474
|
] }),
|
|
13464
|
-
availabilityQuery.isPending ? /* @__PURE__ */
|
|
13465
|
-
/* @__PURE__ */
|
|
13466
|
-
/* @__PURE__ */
|
|
13467
|
-
/* @__PURE__ */
|
|
13468
|
-
] }) : /* @__PURE__ */
|
|
13475
|
+
availabilityQuery.isPending ? /* @__PURE__ */ jsx136(CarListSkeleton, { listStyle }) : availabilityQuery.isError ? /* @__PURE__ */ jsxs92("div", { className: "fb-card flex flex-col items-center justify-center gap-2 px-6 py-16 text-center", children: [
|
|
13476
|
+
/* @__PURE__ */ jsx136("p", { className: "text-sm font-semibold text-foreground", children: "Couldn't complete that search" }),
|
|
13477
|
+
/* @__PURE__ */ jsx136("p", { className: "max-w-xs text-[0.8125rem] text-muted-foreground", children: availabilityQuery.error instanceof Error ? availabilityQuery.error.message : "Please try again." }),
|
|
13478
|
+
/* @__PURE__ */ jsx136(GhostPill, { type: "button", onClick: () => setCriteria(null), className: "mt-3", children: "Change search" })
|
|
13479
|
+
] }) : /* @__PURE__ */ jsx136(
|
|
13469
13480
|
CarList,
|
|
13470
13481
|
{
|
|
13471
13482
|
cars,
|
|
@@ -13479,7 +13490,7 @@ function AmendFlow({
|
|
|
13479
13490
|
onReset: () => setCriteria(null)
|
|
13480
13491
|
}
|
|
13481
13492
|
),
|
|
13482
|
-
car && criteria ? /* @__PURE__ */
|
|
13493
|
+
car && criteria ? /* @__PURE__ */ jsx136(
|
|
13483
13494
|
BookingWizard,
|
|
13484
13495
|
{
|
|
13485
13496
|
car,
|
|
@@ -13512,16 +13523,16 @@ function AmendFlow({
|
|
|
13512
13523
|
import { ArrowLeft as ArrowLeft5, Car as CarIcon10, Cog as Cog8, Flag as Flag4, Fuel as Fuel6, MapPin as MapPin8, Printer as Printer2, ShieldCheck as ShieldCheck8, Users as Users9, Wallet as Wallet3 } from "lucide-react";
|
|
13513
13524
|
|
|
13514
13525
|
// src/components/BookingWizard/ReviewRow.tsx
|
|
13515
|
-
import { jsx as
|
|
13526
|
+
import { jsx as jsx137, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
13516
13527
|
function ReviewRow({ label: label2, children }) {
|
|
13517
|
-
return /* @__PURE__ */
|
|
13518
|
-
/* @__PURE__ */
|
|
13519
|
-
/* @__PURE__ */
|
|
13528
|
+
return /* @__PURE__ */ jsxs93("div", { className: "flex items-start justify-between gap-4 py-1", children: [
|
|
13529
|
+
/* @__PURE__ */ jsx137("dt", { className: "shrink-0 text-[0.8125rem] text-muted-foreground", children: label2 }),
|
|
13530
|
+
/* @__PURE__ */ jsx137("dd", { className: "fb-tabular min-w-0 text-right text-[0.875rem] text-foreground", children })
|
|
13520
13531
|
] });
|
|
13521
13532
|
}
|
|
13522
13533
|
|
|
13523
13534
|
// src/components/ManageBooking/Receipt.tsx
|
|
13524
|
-
import { jsx as
|
|
13535
|
+
import { jsx as jsx138, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
13525
13536
|
function Receipt({ booking, onBack }) {
|
|
13526
13537
|
const vehicleSpecs = [
|
|
13527
13538
|
booking.vehicle.seats != null && { icon: Users9, label: `${booking.vehicle.seats} seats` },
|
|
@@ -13549,55 +13560,55 @@ function Receipt({ booking, onBack }) {
|
|
|
13549
13560
|
subtitle: booking.rentalDays ? `${booking.rentalDays} ${booking.rentalDays === 1 ? "day" : "days"}` : void 0
|
|
13550
13561
|
}
|
|
13551
13562
|
];
|
|
13552
|
-
return /* @__PURE__ */
|
|
13553
|
-
/* @__PURE__ */
|
|
13554
|
-
/* @__PURE__ */
|
|
13563
|
+
return /* @__PURE__ */ jsxs94("div", { className: "mx-auto flex max-w-2xl flex-col gap-5", children: [
|
|
13564
|
+
/* @__PURE__ */ jsxs94("div", { className: "fb-no-print flex items-center justify-between", children: [
|
|
13565
|
+
/* @__PURE__ */ jsxs94(
|
|
13555
13566
|
"button",
|
|
13556
13567
|
{
|
|
13557
13568
|
type: "button",
|
|
13558
13569
|
onClick: onBack,
|
|
13559
13570
|
className: "fb-focus flex items-center gap-1.5 rounded-full px-1 text-[0.8125rem] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
13560
13571
|
children: [
|
|
13561
|
-
/* @__PURE__ */
|
|
13572
|
+
/* @__PURE__ */ jsx138(ArrowLeft5, { className: "size-4", "aria-hidden": "true" }),
|
|
13562
13573
|
"Back to booking"
|
|
13563
13574
|
]
|
|
13564
13575
|
}
|
|
13565
13576
|
),
|
|
13566
|
-
/* @__PURE__ */
|
|
13567
|
-
/* @__PURE__ */
|
|
13577
|
+
/* @__PURE__ */ jsxs94(CtaButton, { type: "button", onClick: () => window.print(), children: [
|
|
13578
|
+
/* @__PURE__ */ jsx138(Printer2, { className: "size-4", "aria-hidden": "true" }),
|
|
13568
13579
|
"Print / Save as PDF"
|
|
13569
13580
|
] })
|
|
13570
13581
|
] }),
|
|
13571
|
-
/* @__PURE__ */
|
|
13572
|
-
/* @__PURE__ */
|
|
13573
|
-
/* @__PURE__ */
|
|
13574
|
-
/* @__PURE__ */
|
|
13582
|
+
/* @__PURE__ */ jsxs94("div", { className: "fb-receipt-print flex flex-col gap-5", children: [
|
|
13583
|
+
/* @__PURE__ */ jsxs94("header", { children: [
|
|
13584
|
+
/* @__PURE__ */ jsx138("p", { className: "fb-eyebrow text-muted-foreground", children: "Booking receipt" }),
|
|
13585
|
+
/* @__PURE__ */ jsx138("h1", { className: "mt-1 text-[1.75rem] leading-[1.1] font-semibold tracking-[-0.02em] text-foreground sm:text-[2.25rem]", children: booking.vehicle.name || booking.vehicle.group || "Your car" })
|
|
13575
13586
|
] }),
|
|
13576
|
-
/* @__PURE__ */
|
|
13577
|
-
/* @__PURE__ */
|
|
13578
|
-
/* @__PURE__ */
|
|
13579
|
-
booking.vehicle.image ? /* @__PURE__ */
|
|
13580
|
-
/* @__PURE__ */
|
|
13587
|
+
/* @__PURE__ */ jsxs94("div", { className: "grid gap-5 sm:grid-cols-[1.1fr_1fr]", children: [
|
|
13588
|
+
/* @__PURE__ */ jsxs94("div", { className: "overflow-hidden rounded-2xl border border-border bg-card shadow-panel", children: [
|
|
13589
|
+
/* @__PURE__ */ jsxs94("div", { className: "relative h-44 bg-car-photo sm:h-full sm:min-h-48", children: [
|
|
13590
|
+
booking.vehicle.image ? /* @__PURE__ */ jsx138("img", { src: booking.vehicle.image, alt: "", className: "fb-photo size-full object-contain p-6" }) : /* @__PURE__ */ jsx138("div", { className: "grid size-full place-items-center text-muted-foreground", "aria-hidden": "true", children: /* @__PURE__ */ jsx138(CarIcon10, { className: "size-12 opacity-30", strokeWidth: 1 }) }),
|
|
13591
|
+
/* @__PURE__ */ jsx138("span", { className: "absolute top-3 right-3 rounded-full border border-border bg-card px-3 py-1 text-[0.75rem] font-semibold text-foreground", children: statusLabel(booking.status) })
|
|
13581
13592
|
] }),
|
|
13582
|
-
/* @__PURE__ */
|
|
13583
|
-
/* @__PURE__ */
|
|
13584
|
-
/* @__PURE__ */
|
|
13585
|
-
vehicleSpecs.length > 0 && /* @__PURE__ */
|
|
13586
|
-
/* @__PURE__ */
|
|
13593
|
+
/* @__PURE__ */ jsxs94("div", { className: "border-t border-border p-5", children: [
|
|
13594
|
+
/* @__PURE__ */ jsx138("p", { className: "text-[1.0625rem] font-semibold text-foreground", children: booking.vehicle.name || "Vehicle" }),
|
|
13595
|
+
/* @__PURE__ */ jsx138("p", { className: "mt-0.5 text-[0.8125rem] text-muted-foreground", children: [booking.vehicle.group && `Group ${booking.vehicle.group}`, booking.supplierName].filter(Boolean).join(" \xB7 ") }),
|
|
13596
|
+
vehicleSpecs.length > 0 && /* @__PURE__ */ jsx138("ul", { className: "mt-3 flex flex-wrap items-center gap-1.5 text-[0.75rem] text-muted-foreground", children: vehicleSpecs.map((spec) => /* @__PURE__ */ jsx138(MiniSpec, { icon: spec.icon, children: spec.label }, spec.label)) }),
|
|
13597
|
+
/* @__PURE__ */ jsx138("div", { className: "mt-3", children: /* @__PURE__ */ jsx138(CopyChip, { label: "Booking number", value: booking.supplierRef ?? "" }) })
|
|
13587
13598
|
] })
|
|
13588
13599
|
] }),
|
|
13589
|
-
/* @__PURE__ */
|
|
13600
|
+
/* @__PURE__ */ jsx138(BookingStepper, { items: steps })
|
|
13590
13601
|
] }),
|
|
13591
|
-
/* @__PURE__ */
|
|
13592
|
-
/* @__PURE__ */
|
|
13593
|
-
/* @__PURE__ */
|
|
13594
|
-
/* @__PURE__ */
|
|
13602
|
+
/* @__PURE__ */ jsx138("div", { className: "rounded-2xl border border-border bg-card p-5 shadow-panel", children: /* @__PURE__ */ jsxs94("dl", { className: "flex flex-col gap-2", children: [
|
|
13603
|
+
/* @__PURE__ */ jsx138(ReviewRow, { label: "Renter", children: booking.customer.name || "\u2014" }),
|
|
13604
|
+
/* @__PURE__ */ jsx138(ReviewRow, { label: "Email", children: booking.customer.email || "\u2014" }),
|
|
13605
|
+
/* @__PURE__ */ jsx138(ReviewRow, { label: "Booked on", children: formatDateTime(booking.createdAt) })
|
|
13595
13606
|
] }) }),
|
|
13596
|
-
booking.extras.length > 0 && /* @__PURE__ */
|
|
13597
|
-
/* @__PURE__ */
|
|
13598
|
-
/* @__PURE__ */
|
|
13599
|
-
/* @__PURE__ */
|
|
13600
|
-
extra.unitPrice != null && /* @__PURE__ */
|
|
13607
|
+
booking.extras.length > 0 && /* @__PURE__ */ jsxs94("div", { className: "rounded-2xl border border-border bg-card p-5 shadow-panel", children: [
|
|
13608
|
+
/* @__PURE__ */ jsx138("p", { className: "fb-eyebrow mb-3 text-muted-foreground", children: "Add-ons" }),
|
|
13609
|
+
/* @__PURE__ */ jsx138("ul", { className: "flex flex-col gap-2", children: booking.extras.map((extra) => /* @__PURE__ */ jsxs94("li", { className: "flex items-start justify-between gap-4", children: [
|
|
13610
|
+
/* @__PURE__ */ jsx138("span", { className: "min-w-0 text-[0.8125rem] text-foreground", children: extra.quantity > 1 ? `${extra.name} \xD7 ${extra.quantity}` : extra.name }),
|
|
13611
|
+
extra.unitPrice != null && /* @__PURE__ */ jsx138("span", { className: "fb-tabular shrink-0 text-[0.8125rem] font-medium text-foreground", children: formatZAR(extra.unitPrice * extra.quantity) })
|
|
13601
13612
|
] }, extra.code)) })
|
|
13602
13613
|
] })
|
|
13603
13614
|
] })
|
|
@@ -13605,7 +13616,7 @@ function Receipt({ booking, onBack }) {
|
|
|
13605
13616
|
}
|
|
13606
13617
|
|
|
13607
13618
|
// src/components/ManageBooking/index.tsx
|
|
13608
|
-
import { Fragment as Fragment20, jsx as
|
|
13619
|
+
import { Fragment as Fragment20, jsx as jsx139, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
13609
13620
|
var Z_ABOVE_HOST_THEME2 = "z-2147483000";
|
|
13610
13621
|
function readDeepLink() {
|
|
13611
13622
|
const merged = new URLSearchParams(window.location.search);
|
|
@@ -13784,8 +13795,8 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13784
13795
|
setLookupError(null);
|
|
13785
13796
|
setLookupOpen(!inlineLookup);
|
|
13786
13797
|
};
|
|
13787
|
-
return /* @__PURE__ */
|
|
13788
|
-
inlineLookup && /* @__PURE__ */
|
|
13798
|
+
return /* @__PURE__ */ jsxs95("div", { className: "@container", children: [
|
|
13799
|
+
inlineLookup && /* @__PURE__ */ jsx139(
|
|
13789
13800
|
LookupForm,
|
|
13790
13801
|
{
|
|
13791
13802
|
look: findLook,
|
|
@@ -13794,18 +13805,18 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13794
13805
|
defaultBookingPin: bookingPin
|
|
13795
13806
|
}
|
|
13796
13807
|
),
|
|
13797
|
-
showTrigger && !inlineLookup && /* @__PURE__ */
|
|
13798
|
-
/* @__PURE__ */
|
|
13808
|
+
showTrigger && !inlineLookup && /* @__PURE__ */ jsxs95(CtaButton, { type: "button", onClick: () => setLookupOpen(true), className: "h-11 px-6", children: [
|
|
13809
|
+
/* @__PURE__ */ jsx139(TicketCheck2, { className: "size-4", "aria-hidden": "true" }),
|
|
13799
13810
|
"Manage my booking"
|
|
13800
13811
|
] }),
|
|
13801
|
-
/* @__PURE__ */
|
|
13812
|
+
/* @__PURE__ */ jsx139(Dialog, { open: lookupOpen, onOpenChange: setLookupOpen, children: /* @__PURE__ */ jsxs95(
|
|
13802
13813
|
DialogContent,
|
|
13803
13814
|
{
|
|
13804
13815
|
className: `${Z_ABOVE_HOST_THEME2} rounded-2xl p-6 sm:max-w-md sm:p-8`,
|
|
13805
13816
|
overlayClassName: Z_ABOVE_HOST_THEME2,
|
|
13806
13817
|
children: [
|
|
13807
|
-
/* @__PURE__ */
|
|
13808
|
-
/* @__PURE__ */
|
|
13818
|
+
/* @__PURE__ */ jsx139(DialogTitle, { className: "sr-only", children: "Manage your booking" }),
|
|
13819
|
+
/* @__PURE__ */ jsx139(
|
|
13809
13820
|
LookupForm,
|
|
13810
13821
|
{
|
|
13811
13822
|
onFound: handleFound,
|
|
@@ -13817,7 +13828,7 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13817
13828
|
]
|
|
13818
13829
|
}
|
|
13819
13830
|
) }),
|
|
13820
|
-
/* @__PURE__ */
|
|
13831
|
+
/* @__PURE__ */ jsx139(Sheet, { open: drawerOpen, onOpenChange: setDrawerOpen, children: /* @__PURE__ */ jsxs95(
|
|
13821
13832
|
SheetContent,
|
|
13822
13833
|
{
|
|
13823
13834
|
side: "bottom",
|
|
@@ -13831,51 +13842,51 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13831
13842
|
overlayClassName: `${Z_ABOVE_HOST_THEME2} bg-black/45`,
|
|
13832
13843
|
className: `${Z_ABOVE_HOST_THEME2} inset-x-0 bottom-0 flex h-dvh max-h-dvh w-screen flex-col gap-0 overflow-hidden rounded-none border-0 bg-background p-0 shadow-none data-[side=bottom]:h-dvh data-[side=bottom]:max-h-dvh`,
|
|
13833
13844
|
children: [
|
|
13834
|
-
view === "amend" && booking && /* @__PURE__ */
|
|
13845
|
+
view === "amend" && booking && /* @__PURE__ */ jsxs95("p", { className: "shrink-0 bg-primary px-4 py-2 text-center text-[0.8125rem] font-semibold text-primary-foreground sm:px-6", children: [
|
|
13835
13846
|
"Amending ",
|
|
13836
13847
|
reservationNumber,
|
|
13837
13848
|
" with ",
|
|
13838
13849
|
booking.supplierName || "this supplier",
|
|
13839
13850
|
". Only their cars will show."
|
|
13840
13851
|
] }),
|
|
13841
|
-
/* @__PURE__ */
|
|
13842
|
-
/* @__PURE__ */
|
|
13843
|
-
/* @__PURE__ */
|
|
13852
|
+
/* @__PURE__ */ jsxs95("header", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border bg-background px-4 py-3.5 sm:px-6 lg:px-8", children: [
|
|
13853
|
+
/* @__PURE__ */ jsxs95(SheetTitle, { className: "flex min-w-0 items-center gap-2.5 truncate text-[1rem] leading-tight font-semibold tracking-[-0.01em]", children: [
|
|
13854
|
+
/* @__PURE__ */ jsx139(
|
|
13844
13855
|
"span",
|
|
13845
13856
|
{
|
|
13846
13857
|
"aria-hidden": "true",
|
|
13847
13858
|
className: "grid size-8 shrink-0 place-items-center rounded-lg bg-wizard-selected/10 text-foreground",
|
|
13848
|
-
children: /* @__PURE__ */
|
|
13859
|
+
children: /* @__PURE__ */ jsx139(TicketCheck2, { className: "size-4", strokeWidth: 1.75 })
|
|
13849
13860
|
}
|
|
13850
13861
|
),
|
|
13851
13862
|
view === "quote-review" ? "Your quote" : "Manage your booking"
|
|
13852
13863
|
] }),
|
|
13853
|
-
/* @__PURE__ */
|
|
13854
|
-
/* @__PURE__ */
|
|
13864
|
+
/* @__PURE__ */ jsxs95(GhostPill, { type: "button", onClick: () => setDrawerOpen(false), children: [
|
|
13865
|
+
/* @__PURE__ */ jsx139(X6, { className: "size-3.5", "aria-hidden": "true" }),
|
|
13855
13866
|
"Close"
|
|
13856
13867
|
] })
|
|
13857
13868
|
] }),
|
|
13858
|
-
/* @__PURE__ */
|
|
13869
|
+
/* @__PURE__ */ jsxs95(
|
|
13859
13870
|
"div",
|
|
13860
13871
|
{
|
|
13861
13872
|
ref: setContainerRef,
|
|
13862
13873
|
className: "fb-hidden min-h-0 flex-1 overflow-y-auto overscroll-contain bg-background px-4 py-6 sm:px-8 sm:py-8",
|
|
13863
13874
|
children: [
|
|
13864
|
-
view === "looking-up" && /* @__PURE__ */
|
|
13865
|
-
/* @__PURE__ */
|
|
13875
|
+
view === "looking-up" && /* @__PURE__ */ jsxs95("div", { className: "flex flex-col items-center gap-4 py-24 text-center", role: "status", children: [
|
|
13876
|
+
/* @__PURE__ */ jsx139(
|
|
13866
13877
|
"span",
|
|
13867
13878
|
{
|
|
13868
13879
|
className: "fb-spinner size-10 rounded-full border-[3px] border-wizard-selected/20 border-t-wizard-selected",
|
|
13869
13880
|
"aria-hidden": "true"
|
|
13870
13881
|
}
|
|
13871
13882
|
),
|
|
13872
|
-
/* @__PURE__ */
|
|
13883
|
+
/* @__PURE__ */ jsx139("p", { className: "text-[0.9375rem] font-medium text-foreground", children: lookupCopy })
|
|
13873
13884
|
] }),
|
|
13874
|
-
view === "quote-error" && /* @__PURE__ */
|
|
13875
|
-
/* @__PURE__ */
|
|
13876
|
-
/* @__PURE__ */
|
|
13877
|
-
/* @__PURE__ */
|
|
13878
|
-
/* @__PURE__ */
|
|
13885
|
+
view === "quote-error" && /* @__PURE__ */ jsxs95("div", { className: "mx-auto flex max-w-md flex-col items-center gap-3 py-20 text-center", role: "alert", children: [
|
|
13886
|
+
/* @__PURE__ */ jsx139("span", { className: "mb-1 grid size-12 place-items-center rounded-full bg-destructive/10 text-destructive", children: /* @__PURE__ */ jsx139(CircleAlert6, { className: "size-5", "aria-hidden": "true" }) }),
|
|
13887
|
+
/* @__PURE__ */ jsx139("p", { className: "text-base font-semibold text-foreground", children: "We couldn't open that" }),
|
|
13888
|
+
/* @__PURE__ */ jsx139("p", { className: "max-w-sm text-[0.875rem] leading-relaxed text-muted-foreground", children: quoteError }),
|
|
13889
|
+
/* @__PURE__ */ jsx139(
|
|
13879
13890
|
GhostPill,
|
|
13880
13891
|
{
|
|
13881
13892
|
type: "button",
|
|
@@ -13887,8 +13898,8 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13887
13898
|
}
|
|
13888
13899
|
)
|
|
13889
13900
|
] }),
|
|
13890
|
-
view === "quote-review" && quoted && /* @__PURE__ */
|
|
13891
|
-
view === "amend" && booking && /* @__PURE__ */
|
|
13901
|
+
view === "quote-review" && quoted && /* @__PURE__ */ jsx139(QuoteReview, { quote: quoted, booking: confirmingQuote, onBook: bookQuoted }),
|
|
13902
|
+
view === "amend" && booking && /* @__PURE__ */ jsx139(
|
|
13892
13903
|
AmendFlow,
|
|
13893
13904
|
{
|
|
13894
13905
|
reservationNumber,
|
|
@@ -13902,9 +13913,9 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13902
13913
|
listStyle
|
|
13903
13914
|
}
|
|
13904
13915
|
),
|
|
13905
|
-
view === "receipt" && booking && /* @__PURE__ */
|
|
13906
|
-
view === "overview" && booking && /* @__PURE__ */
|
|
13907
|
-
/* @__PURE__ */
|
|
13916
|
+
view === "receipt" && booking && /* @__PURE__ */ jsx139(Receipt, { booking, onBack: () => setView("overview") }),
|
|
13917
|
+
view === "overview" && booking && /* @__PURE__ */ jsxs95(Fragment20, { children: [
|
|
13918
|
+
/* @__PURE__ */ jsx139(
|
|
13908
13919
|
BookingOverview,
|
|
13909
13920
|
{
|
|
13910
13921
|
booking,
|
|
@@ -13915,7 +13926,7 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13915
13926
|
onStartOver: startOver
|
|
13916
13927
|
}
|
|
13917
13928
|
),
|
|
13918
|
-
/* @__PURE__ */
|
|
13929
|
+
/* @__PURE__ */ jsx139(
|
|
13919
13930
|
CancelDialog,
|
|
13920
13931
|
{
|
|
13921
13932
|
reservationNumber,
|
|
@@ -13938,7 +13949,7 @@ function ManageBooking({ showTrigger = false, listStyle }) {
|
|
|
13938
13949
|
// src/components/PaymentReturn.tsx
|
|
13939
13950
|
import { useCallback as useCallback4, useEffect as useEffect23, useRef as useRef15, useState as useState24 } from "react";
|
|
13940
13951
|
import { CircleAlert as CircleAlert7, CircleCheck as CircleCheck3, LoaderCircle as LoaderCircle6, RotateCw as RotateCw2 } from "lucide-react";
|
|
13941
|
-
import { Fragment as Fragment21, jsx as
|
|
13952
|
+
import { Fragment as Fragment21, jsx as jsx140, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
13942
13953
|
var Z_ABOVE_HOST_THEME3 = "z-2147483000";
|
|
13943
13954
|
var WAIT_MS = 3e3;
|
|
13944
13955
|
var MAX_TRIES = 8;
|
|
@@ -13992,81 +14003,81 @@ function PaymentReturn() {
|
|
|
13992
14003
|
setView({ kind: "failed", message: result.error });
|
|
13993
14004
|
};
|
|
13994
14005
|
if (!token || saved?.wizard) return null;
|
|
13995
|
-
return /* @__PURE__ */
|
|
13996
|
-
view.kind === "checking" && /* @__PURE__ */
|
|
13997
|
-
view.kind === "confirmed" && /* @__PURE__ */
|
|
13998
|
-
/* @__PURE__ */
|
|
13999
|
-
/* @__PURE__ */
|
|
14000
|
-
/* @__PURE__ */
|
|
14001
|
-
/* @__PURE__ */
|
|
14002
|
-
/* @__PURE__ */
|
|
14006
|
+
return /* @__PURE__ */ jsx140(Dialog, { open, onOpenChange: (next) => !next && close(), children: /* @__PURE__ */ jsxs96(DialogContent, { className: `${Z_ABOVE_HOST_THEME3} rounded-2xl p-6 sm:max-w-md sm:p-8`, overlayClassName: Z_ABOVE_HOST_THEME3, children: [
|
|
14007
|
+
view.kind === "checking" && /* @__PURE__ */ jsx140(Body, { icon: /* @__PURE__ */ jsx140(LoaderCircle6, { className: "size-6 animate-spin text-muted-foreground" }), title: "Checking your payment", text: "This takes a few seconds. Please keep this page open." }),
|
|
14008
|
+
view.kind === "confirmed" && /* @__PURE__ */ jsxs96(Fragment21, { children: [
|
|
14009
|
+
/* @__PURE__ */ jsx140(Body, { icon: /* @__PURE__ */ jsx140(CircleCheck3, { className: "size-6 text-wizard-selected" }), title: "Paid, and your booking is confirmed", text: "Keep these two codes: you need both to find or change your booking." }),
|
|
14010
|
+
/* @__PURE__ */ jsxs96("dl", { className: "mt-5 grid grid-cols-2 gap-3 rounded-xl border border-border bg-surface-2 p-4", children: [
|
|
14011
|
+
/* @__PURE__ */ jsxs96("div", { children: [
|
|
14012
|
+
/* @__PURE__ */ jsx140("dt", { className: "text-[0.75rem] text-muted-foreground", children: "Booking number" }),
|
|
14013
|
+
/* @__PURE__ */ jsx140("dd", { className: "fb-tabular text-[1.125rem] font-semibold text-foreground", children: view.check.reservationId })
|
|
14003
14014
|
] }),
|
|
14004
|
-
/* @__PURE__ */
|
|
14005
|
-
/* @__PURE__ */
|
|
14006
|
-
/* @__PURE__ */
|
|
14015
|
+
/* @__PURE__ */ jsxs96("div", { children: [
|
|
14016
|
+
/* @__PURE__ */ jsx140("dt", { className: "text-[0.75rem] text-muted-foreground", children: "PIN" }),
|
|
14017
|
+
/* @__PURE__ */ jsx140("dd", { className: "fb-tabular text-[1.125rem] font-semibold text-foreground", children: view.check.bookingPin })
|
|
14007
14018
|
] })
|
|
14008
14019
|
] }),
|
|
14009
|
-
/* @__PURE__ */
|
|
14020
|
+
/* @__PURE__ */ jsx140(CtaButton, { type: "button", onClick: close, className: "mt-6 h-11 w-full", children: "Done" })
|
|
14010
14021
|
] }),
|
|
14011
|
-
view.kind === "waiting" && /* @__PURE__ */
|
|
14012
|
-
/* @__PURE__ */
|
|
14022
|
+
view.kind === "waiting" && /* @__PURE__ */ jsxs96(Fragment21, { children: [
|
|
14023
|
+
/* @__PURE__ */ jsx140(
|
|
14013
14024
|
Body,
|
|
14014
14025
|
{
|
|
14015
|
-
icon: /* @__PURE__ */
|
|
14026
|
+
icon: /* @__PURE__ */ jsx140(LoaderCircle6, { className: "size-6 text-muted-foreground" }),
|
|
14016
14027
|
title: "We are still waiting for the payment",
|
|
14017
14028
|
text: "The payment company has not told us yet. This can take a minute. Check again, or look out for your confirmation email."
|
|
14018
14029
|
}
|
|
14019
14030
|
),
|
|
14020
|
-
/* @__PURE__ */
|
|
14031
|
+
/* @__PURE__ */ jsxs96(CtaButton, { type: "button", onClick: () => {
|
|
14021
14032
|
tries.current = 0;
|
|
14022
14033
|
void check();
|
|
14023
14034
|
}, className: "mt-6 h-11 w-full", children: [
|
|
14024
|
-
/* @__PURE__ */
|
|
14035
|
+
/* @__PURE__ */ jsx140(RotateCw2, { className: "size-4", "aria-hidden": "true" }),
|
|
14025
14036
|
"Check again"
|
|
14026
14037
|
] })
|
|
14027
14038
|
] }),
|
|
14028
|
-
view.kind === "attention" && /* @__PURE__ */
|
|
14029
|
-
/* @__PURE__ */
|
|
14039
|
+
view.kind === "attention" && /* @__PURE__ */ jsxs96(Fragment21, { children: [
|
|
14040
|
+
/* @__PURE__ */ jsx140(
|
|
14030
14041
|
Body,
|
|
14031
14042
|
{
|
|
14032
|
-
icon: /* @__PURE__ */
|
|
14043
|
+
icon: /* @__PURE__ */ jsx140(CircleCheck3, { className: "size-6 text-wizard-selected" }),
|
|
14033
14044
|
title: "We received your payment",
|
|
14034
14045
|
text: "Our team will confirm your booking shortly and send you the booking number. There is no need to pay again."
|
|
14035
14046
|
}
|
|
14036
14047
|
),
|
|
14037
|
-
/* @__PURE__ */
|
|
14048
|
+
/* @__PURE__ */ jsx140(CtaButton, { type: "button", onClick: close, className: "mt-6 h-11 w-full", children: "Done" })
|
|
14038
14049
|
] }),
|
|
14039
|
-
view.kind === "failed" && /* @__PURE__ */
|
|
14040
|
-
/* @__PURE__ */
|
|
14050
|
+
view.kind === "failed" && /* @__PURE__ */ jsxs96(Fragment21, { children: [
|
|
14051
|
+
/* @__PURE__ */ jsx140(
|
|
14041
14052
|
Body,
|
|
14042
14053
|
{
|
|
14043
|
-
icon: /* @__PURE__ */
|
|
14054
|
+
icon: /* @__PURE__ */ jsx140(CircleAlert7, { className: "size-6 text-destructive" }),
|
|
14044
14055
|
title: "Your booking is not paid yet",
|
|
14045
14056
|
text: `${view.message} ${saved ? "The car is kept for you for a short while, so you can try again now." : "Please search again to book this car."}`
|
|
14046
14057
|
}
|
|
14047
14058
|
),
|
|
14048
|
-
/* @__PURE__ */
|
|
14049
|
-
saved && /* @__PURE__ */
|
|
14050
|
-
retrying ? /* @__PURE__ */
|
|
14059
|
+
/* @__PURE__ */ jsxs96("div", { className: "mt-6 flex flex-col gap-2", children: [
|
|
14060
|
+
saved && /* @__PURE__ */ jsxs96(CtaButton, { type: "button", onClick: () => void tryAgain(), disabled: retrying, className: "h-11 w-full", children: [
|
|
14061
|
+
retrying ? /* @__PURE__ */ jsx140(LoaderCircle6, { className: "size-4 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx140(RotateCw2, { className: "size-4", "aria-hidden": "true" }),
|
|
14051
14062
|
"Try paying again"
|
|
14052
14063
|
] }),
|
|
14053
|
-
/* @__PURE__ */
|
|
14064
|
+
/* @__PURE__ */ jsx140(GhostPill, { type: "button", onClick: close, className: "h-10 justify-center", children: "Close" })
|
|
14054
14065
|
] })
|
|
14055
14066
|
] })
|
|
14056
14067
|
] }) });
|
|
14057
14068
|
}
|
|
14058
14069
|
function Body({ icon, title, text }) {
|
|
14059
|
-
return /* @__PURE__ */
|
|
14060
|
-
/* @__PURE__ */
|
|
14061
|
-
/* @__PURE__ */
|
|
14062
|
-
/* @__PURE__ */
|
|
14070
|
+
return /* @__PURE__ */ jsxs96("div", { className: "flex flex-col items-center text-center", children: [
|
|
14071
|
+
/* @__PURE__ */ jsx140("span", { className: "grid size-12 place-items-center rounded-full bg-surface-2", "aria-hidden": "true", children: icon }),
|
|
14072
|
+
/* @__PURE__ */ jsx140(DialogTitle, { className: "mt-4 text-[1.25rem] font-semibold tracking-[-0.01em] text-foreground", children: title }),
|
|
14073
|
+
/* @__PURE__ */ jsx140(DialogDescription, { className: "mt-2 text-[0.875rem] leading-relaxed text-muted-foreground", children: text })
|
|
14063
14074
|
] });
|
|
14064
14075
|
}
|
|
14065
14076
|
|
|
14066
14077
|
// src/components/BookingWizard/ConfirmationPreview.tsx
|
|
14067
14078
|
import { useState as useState25 } from "react";
|
|
14068
14079
|
import { Car as CarIcon11, Eye, X as X7 } from "lucide-react";
|
|
14069
|
-
import { jsx as
|
|
14080
|
+
import { jsx as jsx141, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
14070
14081
|
var PREVIEW_PARAM = "fleetbridge_preview";
|
|
14071
14082
|
function ConfirmationPreview({ enabled }) {
|
|
14072
14083
|
const [open, setOpen] = useState25(
|
|
@@ -14079,7 +14090,7 @@ function ConfirmationPreview({ enabled }) {
|
|
|
14079
14090
|
url.searchParams.delete(PREVIEW_PARAM);
|
|
14080
14091
|
window.history.replaceState(null, "", url);
|
|
14081
14092
|
};
|
|
14082
|
-
return /* @__PURE__ */
|
|
14093
|
+
return /* @__PURE__ */ jsx141(Sheet, { open, onOpenChange: (next) => !next && close(), children: /* @__PURE__ */ jsxs97(
|
|
14083
14094
|
SheetContent,
|
|
14084
14095
|
{
|
|
14085
14096
|
side: "bottom",
|
|
@@ -14095,30 +14106,30 @@ function ConfirmationPreview({ enabled }) {
|
|
|
14095
14106
|
"data-[side=bottom]:data-closed:slide-out-to-bottom"
|
|
14096
14107
|
),
|
|
14097
14108
|
children: [
|
|
14098
|
-
/* @__PURE__ */
|
|
14099
|
-
/* @__PURE__ */
|
|
14109
|
+
/* @__PURE__ */ jsxs97("p", { className: "flex shrink-0 items-center justify-center gap-2 bg-foreground px-4 py-2 text-center text-[0.8125rem] font-medium text-background", children: [
|
|
14110
|
+
/* @__PURE__ */ jsx141(Eye, { className: "size-4 shrink-0", "aria-hidden": "true" }),
|
|
14100
14111
|
"Preview with a sample booking. Nothing was booked and no supplier was contacted."
|
|
14101
14112
|
] }),
|
|
14102
|
-
/* @__PURE__ */
|
|
14103
|
-
/* @__PURE__ */
|
|
14104
|
-
/* @__PURE__ */
|
|
14105
|
-
/* @__PURE__ */
|
|
14113
|
+
/* @__PURE__ */ jsxs97("header", { className: "flex shrink-0 items-center gap-3 border-b border-border bg-background px-4 py-3.5 sm:px-6 lg:px-8", children: [
|
|
14114
|
+
/* @__PURE__ */ jsx141("div", { className: "hidden h-14 w-24 shrink-0 place-items-center overflow-hidden rounded-xl border border-border bg-car-photo text-muted-foreground sm:grid", children: /* @__PURE__ */ jsx141(CarIcon11, { className: "size-5 opacity-50", strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
14115
|
+
/* @__PURE__ */ jsxs97("div", { className: "min-w-0 flex-1", children: [
|
|
14116
|
+
/* @__PURE__ */ jsxs97(SheetTitle, { className: "truncate text-[1rem] leading-tight font-semibold tracking-[-0.01em]", children: [
|
|
14106
14117
|
SAMPLE_CAR.make,
|
|
14107
14118
|
" ",
|
|
14108
14119
|
SAMPLE_CAR.model
|
|
14109
14120
|
] }),
|
|
14110
|
-
/* @__PURE__ */
|
|
14121
|
+
/* @__PURE__ */ jsxs97("p", { className: "mt-0.5 truncate text-[0.75rem] text-muted-foreground", children: [
|
|
14111
14122
|
SAMPLE_CAR.trim,
|
|
14112
14123
|
" \xB7 ",
|
|
14113
14124
|
SAMPLE_CAR.supplier.name
|
|
14114
14125
|
] })
|
|
14115
14126
|
] }),
|
|
14116
|
-
/* @__PURE__ */
|
|
14117
|
-
/* @__PURE__ */
|
|
14127
|
+
/* @__PURE__ */ jsxs97(GhostPill, { type: "button", onClick: close, className: "shrink-0", children: [
|
|
14128
|
+
/* @__PURE__ */ jsx141(X7, { className: "size-3.5", "aria-hidden": "true" }),
|
|
14118
14129
|
"Close"
|
|
14119
14130
|
] })
|
|
14120
14131
|
] }),
|
|
14121
|
-
/* @__PURE__ */
|
|
14132
|
+
/* @__PURE__ */ jsx141("div", { className: "min-h-0 flex-1 overflow-y-auto bg-background px-4 py-7 sm:px-6 sm:py-9 lg:px-10", children: /* @__PURE__ */ jsx141("div", { className: "mx-auto max-w-[80rem]", children: /* @__PURE__ */ jsx141(
|
|
14122
14133
|
BookingConfirmation,
|
|
14123
14134
|
{
|
|
14124
14135
|
car: SAMPLE_CAR,
|
|
@@ -14433,7 +14444,7 @@ function effectiveColors(base, overrides = {}) {
|
|
|
14433
14444
|
|
|
14434
14445
|
// src/components/Reveal.tsx
|
|
14435
14446
|
import { useRef as useRef16 } from "react";
|
|
14436
|
-
import { jsx as
|
|
14447
|
+
import { jsx as jsx142 } from "react/jsx-runtime";
|
|
14437
14448
|
function Reveal({
|
|
14438
14449
|
children,
|
|
14439
14450
|
className,
|
|
@@ -14459,7 +14470,7 @@ function Reveal({
|
|
|
14459
14470
|
[stagger, delay, onScroll],
|
|
14460
14471
|
containerRef
|
|
14461
14472
|
);
|
|
14462
|
-
return /* @__PURE__ */
|
|
14473
|
+
return /* @__PURE__ */ jsx142(Tag, { ref: containerRef, className: cn("fb-hidden", className), children });
|
|
14463
14474
|
}
|
|
14464
14475
|
|
|
14465
14476
|
// src/index.ts
|