@bigz-app/booking-widget 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/booking-widget.js +168 -159
- package/dist/booking-widget.js.map +1 -1
- package/dist/components/EventInstanceSelection.d.ts.map +1 -1
- package/dist/index.cjs +168 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +168 -159
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -2
package/dist/booking-widget.js
CHANGED
|
@@ -10522,7 +10522,7 @@
|
|
|
10522
10522
|
config.googleAds?.conversionId &&
|
|
10523
10523
|
config.googleAds?.consent !== false) {
|
|
10524
10524
|
// Prepare conversion tracking data
|
|
10525
|
-
const conversionValue = data.order.total;
|
|
10525
|
+
const conversionValue = data.order.total / 100;
|
|
10526
10526
|
const transactionId = data.order.id;
|
|
10527
10527
|
// Track the conversion
|
|
10528
10528
|
handleGoogleAdsConversion({
|
|
@@ -10993,16 +10993,7 @@
|
|
|
10993
10993
|
} }) }));
|
|
10994
10994
|
function EventInstanceSelection({ eventInstances, selectedEventType, onEventInstanceSelect, onBackToEventTypes, isOpen, onClose, isLoadingEventInstances = false, isLoadingEventDetails = false, }) {
|
|
10995
10995
|
const [selectedEventInstanceId, setSelectedEventInstanceId] = d$1(null);
|
|
10996
|
-
const [
|
|
10997
|
-
const getEventsForMonth = (monthIndex) => {
|
|
10998
|
-
return eventInstances.filter((instance) => new Date(instance.startTime).getMonth() === monthIndex);
|
|
10999
|
-
};
|
|
11000
|
-
const getMinPriceForMonth = (monthIndex) => {
|
|
11001
|
-
const monthEvents = getEventsForMonth(monthIndex);
|
|
11002
|
-
if (monthEvents.length === 0)
|
|
11003
|
-
return 0;
|
|
11004
|
-
return Math.min(...monthEvents.map((event) => event.price));
|
|
11005
|
-
};
|
|
10996
|
+
const [openGroups, setOpenGroups] = d$1(new Set());
|
|
11006
10997
|
const getMonthPriceDisplayInfo = (minPrice) => {
|
|
11007
10998
|
return getPriceDisplayInfo(minPrice, yearPrices);
|
|
11008
10999
|
};
|
|
@@ -11012,27 +11003,48 @@
|
|
|
11012
11003
|
.filter((instance) => new Date(instance.startTime).getFullYear() === currentYear)
|
|
11013
11004
|
.map((instance) => instance.price);
|
|
11014
11005
|
const today = new Date();
|
|
11015
|
-
//
|
|
11016
|
-
const
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11006
|
+
// Group events by month and year, then sort chronologically (e.g., Aug 2025 before Apr 2026)
|
|
11007
|
+
const monthYearGroups = (() => {
|
|
11008
|
+
const groupsMap = new Map();
|
|
11009
|
+
for (const instance of eventInstances) {
|
|
11010
|
+
const date = new Date(instance.startTime);
|
|
11011
|
+
const year = date.getFullYear();
|
|
11012
|
+
const monthIndex = date.getMonth();
|
|
11013
|
+
const key = `${year}-${monthIndex}`;
|
|
11014
|
+
if (!groupsMap.has(key)) {
|
|
11015
|
+
groupsMap.set(key, {
|
|
11016
|
+
key,
|
|
11017
|
+
year,
|
|
11018
|
+
monthIndex,
|
|
11019
|
+
label: `${months[monthIndex]} ${year}`,
|
|
11020
|
+
events: [],
|
|
11021
|
+
minPrice: Number.POSITIVE_INFINITY,
|
|
11022
|
+
});
|
|
11023
|
+
}
|
|
11024
|
+
const group = groupsMap.get(key);
|
|
11025
|
+
group.events.push(instance);
|
|
11026
|
+
if (instance.price < group.minPrice)
|
|
11027
|
+
group.minPrice = instance.price;
|
|
11028
|
+
}
|
|
11029
|
+
return Array.from(groupsMap.values())
|
|
11030
|
+
.map((group) => ({
|
|
11031
|
+
...group,
|
|
11032
|
+
events: group.events.sort((a, b) => new Date(a.startTime).getTime() - new Date(b.startTime).getTime()),
|
|
11033
|
+
}))
|
|
11034
|
+
.sort((a, b) => (a.year === b.year ? a.monthIndex - b.monthIndex : a.year - b.year));
|
|
11035
|
+
})();
|
|
11024
11036
|
const handleEventInstanceSelect = (eventInstance) => {
|
|
11025
11037
|
setSelectedEventInstanceId(eventInstance.id);
|
|
11026
11038
|
onEventInstanceSelect(eventInstance);
|
|
11027
11039
|
};
|
|
11028
|
-
const
|
|
11029
|
-
if (
|
|
11040
|
+
const toggleGroup = (key) => {
|
|
11041
|
+
if (openGroups.has(key)) {
|
|
11030
11042
|
// Close if already open
|
|
11031
|
-
|
|
11043
|
+
setOpenGroups(new Set());
|
|
11032
11044
|
}
|
|
11033
11045
|
else {
|
|
11034
11046
|
// Open only this one, close others
|
|
11035
|
-
|
|
11047
|
+
setOpenGroups(new Set([key]));
|
|
11036
11048
|
}
|
|
11037
11049
|
};
|
|
11038
11050
|
const handleClose = () => {
|
|
@@ -11289,10 +11301,7 @@
|
|
|
11289
11301
|
minHeight: "400px",
|
|
11290
11302
|
textAlign: "center",
|
|
11291
11303
|
padding: "var(--bw-spacing)",
|
|
11292
|
-
}, children: u$2("div", { children: [u$2("
|
|
11293
|
-
margin: "0 auto 16px",
|
|
11294
|
-
fontSize: "48px",
|
|
11295
|
-
}, children: "\uD83D\uDCC5" }), u$2("h3", { style: {
|
|
11304
|
+
}, children: u$2("div", { children: [u$2("h3", { style: {
|
|
11296
11305
|
marginBottom: "8px",
|
|
11297
11306
|
fontWeight: "600",
|
|
11298
11307
|
fontSize: "var(--bw-font-size-large)",
|
|
@@ -11360,137 +11369,137 @@
|
|
|
11360
11369
|
font-size: 1.1rem !important;
|
|
11361
11370
|
}
|
|
11362
11371
|
}
|
|
11363
|
-
` }), u$2(Sidebar, { isOpen: isOpen, onClose: handleClose, title:
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11372
|
+
` }), u$2(Sidebar, { isOpen: isOpen, onClose: handleClose, title: "Termin-Auswahl", children: [u$2("p", { className: "bw-event-instance-title", children: selectedEventType?.name }), u$2("div", { className: "bw-event-instance-list", style: { padding: "24px" }, children: u$2("div", { style: {
|
|
11373
|
+
display: "flex",
|
|
11374
|
+
flexDirection: "column",
|
|
11375
|
+
gap: "20px",
|
|
11376
|
+
}, children: monthYearGroups.map(({ key, label, events, minPrice }) => {
|
|
11377
|
+
const monthPriceDisplayInfo = getMonthPriceDisplayInfo(minPrice);
|
|
11378
|
+
return (u$2(Accordion, { title: label, priceInfo: u$2("div", { style: {
|
|
11379
|
+
fontSize: "1rem",
|
|
11380
|
+
backgroundColor: monthPriceDisplayInfo
|
|
11381
|
+
? monthPriceDisplayInfo.backgroundColor
|
|
11382
|
+
: "#14532d",
|
|
11383
|
+
color: monthPriceDisplayInfo ? monthPriceDisplayInfo.textColor : "#4ade80",
|
|
11384
|
+
fontWeight: 500,
|
|
11385
|
+
marginLeft: "auto",
|
|
11386
|
+
padding: "4px 8px",
|
|
11387
|
+
borderRadius: "var(--bw-border-radius-small)",
|
|
11388
|
+
border: monthPriceDisplayInfo ? "none" : undefined,
|
|
11389
|
+
boxShadow: monthPriceDisplayInfo
|
|
11390
|
+
? "0 2px 4px rgba(0, 0, 0, 0.2)"
|
|
11391
|
+
: undefined,
|
|
11392
|
+
}, children: `ab ${formatCurrency(minPrice)}` }), isOpen: openGroups.has(key), onToggle: () => toggleGroup(key), children: u$2("div", { style: {
|
|
11393
|
+
display: "flex",
|
|
11394
|
+
flexDirection: "column",
|
|
11395
|
+
gap: "12px",
|
|
11396
|
+
paddingTop: "12px",
|
|
11397
|
+
}, children: events.map((event) => {
|
|
11398
|
+
const availableSpots = event.maxParticipants - event.participantCount;
|
|
11399
|
+
const isFullyBooked = availableSpots === 0;
|
|
11400
|
+
const startDate = new Date(event.startTime);
|
|
11401
|
+
const isPastEvent = today.toISOString() >= startDate.toISOString();
|
|
11402
|
+
return (u$2("div", { className: "bw-event-instance-card", style: {
|
|
11403
|
+
position: "relative",
|
|
11404
|
+
cursor: !isFullyBooked && !isPastEvent && event.bookingOpen
|
|
11405
|
+
? "pointer"
|
|
11406
|
+
: "not-allowed",
|
|
11407
|
+
border: "1px solid var(--bw-border-color)",
|
|
11408
|
+
backgroundColor: "var(--bw-surface-color)",
|
|
11409
|
+
borderRadius: "var(--bw-border-radius)",
|
|
11410
|
+
padding: "16px 20px",
|
|
11411
|
+
transition: "all 0.2s ease",
|
|
11412
|
+
opacity: isFullyBooked || isPastEvent ? 0.3 : 1,
|
|
11413
|
+
filter: isFullyBooked || isPastEvent ? "grayscale(40%)" : "none",
|
|
11414
|
+
fontFamily: "var(--bw-font-family)",
|
|
11415
|
+
}, onClick: () => {
|
|
11416
|
+
if (!isFullyBooked && !isPastEvent && event.bookingOpen) {
|
|
11417
|
+
handleEventInstanceSelect(event);
|
|
11418
|
+
}
|
|
11419
|
+
}, onMouseEnter: (e) => {
|
|
11420
|
+
if (!isFullyBooked && !isPastEvent && event.bookingOpen) {
|
|
11421
|
+
e.currentTarget.style.transform = "scale(1.02)";
|
|
11422
|
+
e.currentTarget.style.backgroundColor =
|
|
11423
|
+
"var(--bw-surface-muted, rgba(59, 130, 246, 0.1))";
|
|
11424
|
+
}
|
|
11425
|
+
}, onMouseLeave: (e) => {
|
|
11426
|
+
if (!isFullyBooked && !isPastEvent && event.bookingOpen) {
|
|
11427
|
+
e.currentTarget.style.transform = "scale(1)";
|
|
11428
|
+
e.currentTarget.style.backgroundColor = "var(--bw-surface-color)";
|
|
11429
|
+
}
|
|
11430
|
+
}, children: [selectedEventInstanceId === event.id && isLoadingEventDetails && (u$2("div", { style: {
|
|
11431
|
+
position: "absolute",
|
|
11432
|
+
top: 0,
|
|
11433
|
+
left: 0,
|
|
11434
|
+
width: "100%",
|
|
11435
|
+
height: "100%",
|
|
11436
|
+
backgroundColor: "var(--bw-overlay-color, rgba(15, 23, 42, 0.8))",
|
|
11437
|
+
borderRadius: "var(--bw-border-radius)",
|
|
11438
|
+
display: "flex",
|
|
11439
|
+
alignItems: "center",
|
|
11440
|
+
justifyContent: "center",
|
|
11441
|
+
}, children: u$2("div", { style: {
|
|
11442
|
+
width: "32px",
|
|
11443
|
+
height: "32px",
|
|
11444
|
+
color: "var(--bw-highlight-color-muted, rgba(59, 130, 246, 0.8))",
|
|
11445
|
+
animation: "spin 1s linear infinite",
|
|
11446
|
+
fontSize: "32px",
|
|
11447
|
+
}, children: spinner() }) })), u$2(SpecialPriceBadge, { price: event.price, yearPrices: yearPrices }), u$2(AllocationBadge, { availableSpots: availableSpots, maxParticipants: event.maxParticipants }), u$2("div", { style: {
|
|
11448
|
+
display: "flex",
|
|
11449
|
+
justifyContent: "space-between",
|
|
11450
|
+
width: "100%",
|
|
11451
|
+
alignItems: "start",
|
|
11452
|
+
gap: "12px",
|
|
11453
|
+
marginBottom: "4px",
|
|
11454
|
+
}, children: [u$2("div", { style: { display: "flex", alignItems: "start", gap: "12px" }, children: [u$2("div", { className: "bw-event-instance-datebox", style: {
|
|
11455
|
+
fontSize: "var(--bw-font-size)",
|
|
11456
|
+
transition: "all 0.2s ease",
|
|
11457
|
+
borderRadius: "var(--bw-border-radius-small)",
|
|
11458
|
+
borderTop: `4px solid var(--bw-border-color)`,
|
|
11459
|
+
border: "1px solid var(--bw-border-color)",
|
|
11460
|
+
width: "40px",
|
|
11461
|
+
height: "40px",
|
|
11462
|
+
display: "flex",
|
|
11463
|
+
alignItems: "center",
|
|
11464
|
+
justifyContent: "center",
|
|
11465
|
+
fontWeight: "bold",
|
|
11466
|
+
color: "var(--bw-text-color)",
|
|
11467
|
+
backgroundColor: "var(--bw-background-color)",
|
|
11468
|
+
}, children: startDate.getDate() }), u$2("div", { style: {
|
|
11469
|
+
fontSize: "var(--bw-font-size)",
|
|
11470
|
+
color: "var(--bw-text-color)",
|
|
11471
|
+
display: "flex",
|
|
11472
|
+
flexDirection: "column",
|
|
11473
|
+
alignItems: "start",
|
|
11474
|
+
justifyContent: "start",
|
|
11475
|
+
lineHeight: "1.2",
|
|
11476
|
+
}, children: [u$2("div", { children: [u$2("span", { className: "bw-event-instance-title", style: { fontWeight: "600", marginBottom: "2px" }, children: formatWeekday(event.startTime) }), formatWeekday(event.startTime) !==
|
|
11477
|
+
formatWeekday(event.endTime) && (u$2(k$3, { children: [u$2("span", { style: { color: "var(--bw-text-muted)", fontSize: "14px" }, children: " - " }), u$2("span", { className: "bw-event-instance-title", style: { fontWeight: "600", marginBottom: "2px" }, children: formatWeekday(event.endTime) })] }))] }), u$2("div", { children: formatWeekday(event.startTime) ===
|
|
11478
|
+
formatWeekday(event.endTime) ? (u$2(k$3, { children: [u$2("span", { style: { color: "var(--bw-text-muted)", fontSize: "14px" }, children: formatTime(event.startTime) }), u$2("span", { style: { color: "var(--bw-text-muted)", fontSize: "14px" }, children: " - " }), u$2("span", { style: { color: "var(--bw-text-muted)", fontSize: "14px" }, children: formatTime(event.endTime) })] })) : (u$2("span", { style: { color: "var(--bw-text-muted)", fontSize: "14px" }, children: [formatTime(event.startTime), " Uhr"] })) })] }), u$2("span", { style: {
|
|
11479
|
+
fontSize: "12px",
|
|
11480
|
+
fontWeight: 400,
|
|
11481
|
+
color: "var(--bw-text-muted)",
|
|
11482
|
+
marginLeft: "6px",
|
|
11483
|
+
background: "var(--bw-background-muted)",
|
|
11484
|
+
whiteSpace: "nowrap",
|
|
11485
|
+
}, children: [event.durationDays, " Tag", event.durationDays > 1 ? "e" : ""] })] }), u$2("div", { className: "bw-event-instance-price", style: {
|
|
11486
|
+
textAlign: "right",
|
|
11487
|
+
display: "flex",
|
|
11488
|
+
flexDirection: "column",
|
|
11489
|
+
alignItems: "end",
|
|
11490
|
+
}, children: u$2(PriceDisplay, { price: event.price, yearPrices: yearPrices }) })] }), event.name !== selectedEventType?.name && (u$2("h4", { className: "bw-event-instance-title", style: {
|
|
11491
|
+
fontSize: "var(--bw-font-size)",
|
|
11492
|
+
fontWeight: "600",
|
|
11493
|
+
color: "var(--bw-text-color)",
|
|
11494
|
+
lineHeight: "1.25",
|
|
11495
|
+
margin: "0 0 2px 0",
|
|
11496
|
+
display: "flex",
|
|
11497
|
+
alignItems: "center",
|
|
11498
|
+
gap: "8px",
|
|
11499
|
+
maxWidth: "230px",
|
|
11500
|
+
}, children: event.name }))] }, event.id));
|
|
11501
|
+
}) }) }, key));
|
|
11502
|
+
}) }) })] })] }));
|
|
11494
11503
|
}
|
|
11495
11504
|
|
|
11496
11505
|
// Loading skeleton component for NextEventsPreview
|