@happychef/reservation-sidebar 2.0.8 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1342 -171
- package/dist/index.mjs +1313 -142
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React9, { useCallback, useMemo, useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
|
+
import moment2 from 'moment-timezone';
|
|
4
|
+
import { getAvailableTablesForTime, getAvailableTimeblocks, getAvailableTimeblocksWithTableCheck, isDateAvailableWithTableCheck, isDateAvailable } from '@happychef/algorithm';
|
|
5
|
+
import { DateTime } from 'luxon';
|
|
6
|
+
import axios from 'axios';
|
|
3
7
|
import Lottie from 'lottie-react';
|
|
4
8
|
import { FaUser, FaEnvelope, FaPhone, FaInfoCircle, FaTimes } from 'react-icons/fa';
|
|
5
|
-
import axios from 'axios';
|
|
6
|
-
import moment2 from 'moment-timezone';
|
|
7
9
|
|
|
8
10
|
var __create = Object.create;
|
|
9
11
|
var __defProp = Object.defineProperty;
|
|
@@ -4041,7 +4043,7 @@ var require_nl = __commonJS({
|
|
|
4041
4043
|
"node_modules/moment/locale/nl.js"(exports$1, module) {
|
|
4042
4044
|
(function(global, factory) {
|
|
4043
4045
|
typeof exports$1 === "object" && typeof module !== "undefined" && typeof __require === "function" ? factory(require_moment()) : typeof define === "function" && define.amd ? define(["../moment"], factory) : factory(global.moment);
|
|
4044
|
-
})(exports$1, (function(
|
|
4046
|
+
})(exports$1, (function(moment7) {
|
|
4045
4047
|
var monthsShortWithDots = "jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"), monthsShortWithoutDots = "jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"), monthsParse = [
|
|
4046
4048
|
/^jan/i,
|
|
4047
4049
|
/^feb/i,
|
|
@@ -4056,7 +4058,7 @@ var require_nl = __commonJS({
|
|
|
4056
4058
|
/^nov/i,
|
|
4057
4059
|
/^dec/i
|
|
4058
4060
|
], monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
|
|
4059
|
-
var nl =
|
|
4061
|
+
var nl = moment7.defineLocale("nl", {
|
|
4060
4062
|
months: "januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split(
|
|
4061
4063
|
"_"
|
|
4062
4064
|
),
|
|
@@ -4152,23 +4154,1125 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
4152
4154
|
}
|
|
4153
4155
|
}
|
|
4154
4156
|
|
|
4157
|
+
// src/components/ReservationStepOne/css/valueSelector.css
|
|
4158
|
+
styleInject(".new-reservation-page .value-selector {\n display: flex;\n flex-direction: column;\n gap: 15px;\n margin-bottom: 20px;\n}\n.new-reservation-page .non-absolute {\n position: relative !important;\n}\n.new-reservation-page .non-absolute::before {\n background: none;\n}\n.new-reservation-page .predefined-values {\n display: flex;\n gap: 10px;\n}\n.new-reservation-page .predefined-value-button {\n flex: 1;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: var(--border-radius);\n background-color: var(--color-white);\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s ease;\n}\n.new-reservation-page .predefined-value-button.active,\n.new-reservation-page .predefined-value-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .slider-container {\n display: flex;\n align-items: center;\n gap: 15px;\n}\n.new-reservation-page .slider {\n flex: 1;\n appearance: none;\n -webkit-appearance: none;\n height: 5px;\n background: #ddd;\n border-radius: 5px;\n outline: none;\n}\n.new-reservation-page .slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: var(--color-blue);\n cursor: pointer;\n border-radius: 50%;\n}\n.new-reservation-page .value-input {\n width: 80px;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: var(--border-radius);\n font-size: 1rem;\n}\n");
|
|
4159
|
+
|
|
4160
|
+
// src/components/ReservationStepOne/ValueSelector.js
|
|
4161
|
+
var ValueSelectorGuests = ({ setGuests, value: value2, onChange }) => {
|
|
4162
|
+
const predefinedValues = [1, 2, 3, "4+"];
|
|
4163
|
+
const [selectedValue, setSelectedValue] = useState(value2 || "");
|
|
4164
|
+
const [showSlider, setShowSlider] = useState(false);
|
|
4165
|
+
const handlePredefinedValueClick = (val) => {
|
|
4166
|
+
if (val === "4+") {
|
|
4167
|
+
setShowSlider(true);
|
|
4168
|
+
setSelectedValue(4);
|
|
4169
|
+
setGuests(4);
|
|
4170
|
+
onChange({ target: { name: "guests", value: 4 } });
|
|
4171
|
+
} else {
|
|
4172
|
+
setShowSlider(false);
|
|
4173
|
+
setSelectedValue(val);
|
|
4174
|
+
setGuests(val);
|
|
4175
|
+
onChange({ target: { name: "guests", value: val } });
|
|
4176
|
+
}
|
|
4177
|
+
};
|
|
4178
|
+
const handleSliderChange = (e) => {
|
|
4179
|
+
const val = e.target.value;
|
|
4180
|
+
setSelectedValue(val);
|
|
4181
|
+
setGuests(val);
|
|
4182
|
+
onChange({ target: { name: "guests", value: val } });
|
|
4183
|
+
};
|
|
4184
|
+
const handleInputChange = (e) => {
|
|
4185
|
+
const val = e.target.value;
|
|
4186
|
+
setSelectedValue(val);
|
|
4187
|
+
setGuests(val);
|
|
4188
|
+
onChange({ target: { name: "guests", value: val } });
|
|
4189
|
+
};
|
|
4190
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "value-selector", translate: "no" }, /* @__PURE__ */ React9.createElement("div", { className: "predefined-values" }, predefinedValues.map((val) => /* @__PURE__ */ React9.createElement(
|
|
4191
|
+
"button",
|
|
4192
|
+
{
|
|
4193
|
+
key: val,
|
|
4194
|
+
type: "button",
|
|
4195
|
+
className: `predefined-value-button ${selectedValue == val || val === "4+" && showSlider ? "active" : ""}`,
|
|
4196
|
+
onClick: () => handlePredefinedValueClick(val)
|
|
4197
|
+
},
|
|
4198
|
+
val === "4+" ? "4+" : `${val} ${val === 1 ? "p" : "p"}`
|
|
4199
|
+
))), /* @__PURE__ */ React9.createElement(AnimatePresence, null, showSlider && /* @__PURE__ */ React9.createElement(
|
|
4200
|
+
motion.div,
|
|
4201
|
+
{
|
|
4202
|
+
className: "slider-container",
|
|
4203
|
+
initial: { opacity: 0, height: 0 },
|
|
4204
|
+
animate: { opacity: 1, height: "auto" },
|
|
4205
|
+
exit: { opacity: 0, height: 0 }
|
|
4206
|
+
},
|
|
4207
|
+
/* @__PURE__ */ React9.createElement(
|
|
4208
|
+
"input",
|
|
4209
|
+
{
|
|
4210
|
+
type: "range",
|
|
4211
|
+
min: "4",
|
|
4212
|
+
max: "15",
|
|
4213
|
+
step: "1",
|
|
4214
|
+
value: selectedValue,
|
|
4215
|
+
onChange: handleSliderChange,
|
|
4216
|
+
className: "slider non-absolute"
|
|
4217
|
+
}
|
|
4218
|
+
),
|
|
4219
|
+
/* @__PURE__ */ React9.createElement(
|
|
4220
|
+
"input",
|
|
4221
|
+
{
|
|
4222
|
+
type: "number",
|
|
4223
|
+
name: "guests",
|
|
4224
|
+
value: selectedValue,
|
|
4225
|
+
onChange: handleInputChange,
|
|
4226
|
+
className: "value-input",
|
|
4227
|
+
min: "4",
|
|
4228
|
+
max: "100",
|
|
4229
|
+
step: "1"
|
|
4230
|
+
}
|
|
4231
|
+
)
|
|
4232
|
+
)));
|
|
4233
|
+
};
|
|
4234
|
+
var ValueSelector_default = ValueSelectorGuests;
|
|
4235
|
+
|
|
4236
|
+
// src/components/ReservationStepOne/Calendar.js
|
|
4237
|
+
__toESM(require_nl());
|
|
4238
|
+
var isWeekInPast = (weekStartDate) => {
|
|
4239
|
+
const today = moment2().tz("Europe/Brussels").startOf("day");
|
|
4240
|
+
const weekEndDate = weekStartDate.clone().add(6, "days").endOf("day");
|
|
4241
|
+
return weekEndDate.isBefore(today);
|
|
4242
|
+
};
|
|
4243
|
+
var isSameDay = (date1, date2) => date1.isSame(date2, "day");
|
|
4244
|
+
|
|
4245
|
+
// src/components/ReservationStepOne/css/calendar.css
|
|
4246
|
+
styleInject(".new-reservation-page .calendar-container {\n position: relative;\n width: 100%;\n}\n.new-reservation-page .calendar-container .calendar-display {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 10px;\n background-color: #fff;\n border: #ccc 1px solid;\n cursor: pointer;\n user-select: none;\n text-align: left;\n border-radius: 5px;\n}\n.new-reservation-page .calendar-container .calendar-display span:first-child {\n flex-grow: 1;\n}\n.new-reservation-page .calendar-container .calendar {\n position: absolute;\n z-index: 1000;\n width: 100%;\n background-color: rgba(255, 255, 255, 1);\n border: 1px solid #ccc;\n margin-top: 5px;\n padding: 10px;\n border-radius: 10px;\n animation: fadeInCalendar 0.3s ease-in-out;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n}\n@keyframes fadeInCalendar {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.new-reservation-page .calendar-container .availability-hold-btn {\n font-size: 10px;\n}\n.new-reservation-page .calendar-container .calendar-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n gap: 8px;\n flex-wrap: wrap;\n}\n.new-reservation-page .calendar-container .calendar-header button {\n background-color: transparent;\n border: none;\n cursor: pointer;\n font-size: 18px;\n}\n.new-reservation-page .calendar-container .calendar-header span {\n font-size: 15px;\n color: gray;\n font-weight: 500;\n}\n.new-reservation-page .calendar-container .calendar-weeks-wrapper {\n overflow: hidden;\n position: relative;\n width: 100%;\n}\n.new-reservation-page .calendar-container .calendar-table {\n width: 100%;\n border-collapse: collapse;\n}\n.new-reservation-page .calendar-container .calendar-table th,\n.new-reservation-page .calendar-container .calendar-table td {\n width: 14.28%;\n text-align: center;\n padding: 5px;\n}\n.calendar-container .calendar-table th {\n color: #666;\n font-weight: normal;\n padding-bottom: 10px;\n}\n.new-reservation-page .calendar-container .calendar-table td {\n vertical-align: middle;\n cursor: pointer;\n border: none;\n opacity: 1;\n position: relative;\n}\n.new-reservation-page .calendar-container .calendar-table td.empty-day {\n cursor: default;\n}\n.new-reservation-page .calendar-container .calendar-table td:hover .day-square.available {\n transform: scale(1.05);\n}\n.new-reservation-page .calendar-container .day-square {\n position: relative;\n width: 38px;\n height: 38px;\n border-radius: 4px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n transition: all 0.2s ease;\n font-size: 16px;\n margin: 0 auto;\n}\n.new-reservation-page .calendar-container .day-number {\n line-height: 1;\n z-index: 2;\n}\n.new-reservation-page .calendar-container .available .day-square {\n background-color: #ccffcc;\n color: #006600;\n}\n.new-reservation-page .calendar-container .available:hover .day-square {\n background-color: #b3ffb3;\n}\n.new-reservation-page .calendar-container .available:active .day-square {\n background-color: #99ff99;\n}\n.new-reservation-page .calendar-container .unavailable .day-square {\n background-color: rgba(139, 0, 0, 0.13);\n color: darkred;\n}\n.new-reservation-page .calendar-container .gray-out .day-square {\n background-color: #e0e0e0;\n color: #999;\n cursor: not-allowed;\n}\n.new-reservation-page .calendar-container .selected .day-square {\n background-color: #006600;\n color: #ccffcc;\n}\n.new-reservation-page .calendar-container .calendar-table td.unavailable,\n.new-reservation-page .calendar-container .calendar-table td.gray-out {\n cursor: not-allowed;\n}\n.new-reservation-page .calendar-container .calendar-table td.unavailable:hover .day-square,\n.new-reservation-page .calendar-container .calendar-table td.gray-out:hover .day-square {\n transform: none;\n}\n.new-reservation-page .calendar-container .calendar-table td {\n border: none;\n}\n.new-reservation-page .calendar-container .arrow {\n margin-left: auto;\n color: gray;\n display: flex;\n align-items: center;\n}\n.new-reservation-page .calendar-container .available .availability-badge {\n background: #38a169;\n}\n.new-reservation-page .calendar-container .selected .availability-badge {\n background: #2d3748;\n}\n@media screen and (max-width: 900px) {\n .calendar-container .day-square {\n width: 35px !important;\n height: 35px !important;\n font-size: 15px !important;\n }\n .calendar-container .calendar-header span {\n font-size: 12px;\n }\n .new-reservation-page .calendar-container .availability-toggle-btn {\n padding: 5px 8px;\n font-size: 11px;\n }\n}\n");
|
|
4247
|
+
|
|
4248
|
+
// src/components/ReservationStepOne/translations.json
|
|
4249
|
+
var translations_default = {
|
|
4250
|
+
nl: {
|
|
4251
|
+
reservationStepOne: {
|
|
4252
|
+
errors: {
|
|
4253
|
+
openingHoursNotSet: "Openingstijden niet ingesteld.",
|
|
4254
|
+
clickHereToSet: "Klik hier om uw openingsuren in te stellen."
|
|
4255
|
+
},
|
|
4256
|
+
modes: {
|
|
4257
|
+
withLimits: "Met Limieten",
|
|
4258
|
+
unlimited: "Onbeperkt",
|
|
4259
|
+
openingHours: "Openingsuren",
|
|
4260
|
+
free: "Vrij"
|
|
4261
|
+
},
|
|
4262
|
+
fields: {
|
|
4263
|
+
time: "Tijd"
|
|
4264
|
+
},
|
|
4265
|
+
messages: {
|
|
4266
|
+
searchingTables: "Beschikbare tafels zoeken...",
|
|
4267
|
+
noTablesAvailable: "Geen specifieke tafels beschikbaar voor deze selectie."
|
|
4268
|
+
},
|
|
4269
|
+
warnings: {
|
|
4270
|
+
unlimitedMode: "Onbeperkt zal geen rekening houden met maximum limieten."
|
|
4271
|
+
}
|
|
4272
|
+
},
|
|
4273
|
+
calendar: {
|
|
4274
|
+
selectDatePlaceholder: "Selecteer een datum",
|
|
4275
|
+
today: "Vandaag",
|
|
4276
|
+
tomorrow: "Morgen",
|
|
4277
|
+
prevWeek: "Vorige week",
|
|
4278
|
+
nextWeek: "Volgende week",
|
|
4279
|
+
dayHeaders: ["Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],
|
|
4280
|
+
seatsQuestion: "Zitplaatsen?"
|
|
4281
|
+
},
|
|
4282
|
+
timeSelector: {
|
|
4283
|
+
shifts: {
|
|
4284
|
+
breakfast: "Ontbijt",
|
|
4285
|
+
lunch: "Lunch",
|
|
4286
|
+
dinner: "Diner"
|
|
4287
|
+
},
|
|
4288
|
+
selectMeal: "Selecteer een maaltijd",
|
|
4289
|
+
selectTime: "Selecteer een tijd",
|
|
4290
|
+
noDateSelected: "Selecteer eerst een datum.",
|
|
4291
|
+
noTimes: "Geen beschikbare tijden.",
|
|
4292
|
+
back: "Terug"
|
|
4293
|
+
},
|
|
4294
|
+
tableSelector: {
|
|
4295
|
+
label: "Selecteer beschikbare tafel(s):",
|
|
4296
|
+
table: "Tafel",
|
|
4297
|
+
max: "Max",
|
|
4298
|
+
noTables: "Geen specifieke tafels beschikbaar voor deze tijd/gasten combinatie."
|
|
4299
|
+
}
|
|
4300
|
+
},
|
|
4301
|
+
en: {
|
|
4302
|
+
reservationStepOne: {
|
|
4303
|
+
errors: {
|
|
4304
|
+
openingHoursNotSet: "Opening hours not set.",
|
|
4305
|
+
clickHereToSet: "Click here to set your opening hours."
|
|
4306
|
+
},
|
|
4307
|
+
modes: {
|
|
4308
|
+
withLimits: "With Limits",
|
|
4309
|
+
unlimited: "Unlimited",
|
|
4310
|
+
openingHours: "Opening Hours",
|
|
4311
|
+
free: "Free"
|
|
4312
|
+
},
|
|
4313
|
+
fields: {
|
|
4314
|
+
time: "Time"
|
|
4315
|
+
},
|
|
4316
|
+
messages: {
|
|
4317
|
+
searchingTables: "Searching for available tables...",
|
|
4318
|
+
noTablesAvailable: "No specific tables available for this selection."
|
|
4319
|
+
},
|
|
4320
|
+
warnings: {
|
|
4321
|
+
unlimitedMode: "Unlimited will not take into account maximum limits."
|
|
4322
|
+
}
|
|
4323
|
+
},
|
|
4324
|
+
calendar: {
|
|
4325
|
+
selectDatePlaceholder: "Select a date",
|
|
4326
|
+
today: "Today",
|
|
4327
|
+
tomorrow: "Tomorrow",
|
|
4328
|
+
prevWeek: "Previous week",
|
|
4329
|
+
nextWeek: "Next week",
|
|
4330
|
+
dayHeaders: ["M", "T", "W", "T", "F", "S", "S"],
|
|
4331
|
+
seatsQuestion: "Seating?"
|
|
4332
|
+
},
|
|
4333
|
+
timeSelector: {
|
|
4334
|
+
shifts: {
|
|
4335
|
+
breakfast: "Breakfast",
|
|
4336
|
+
lunch: "Lunch",
|
|
4337
|
+
dinner: "Dinner"
|
|
4338
|
+
},
|
|
4339
|
+
selectMeal: "Select a meal",
|
|
4340
|
+
selectTime: "Select a time",
|
|
4341
|
+
noDateSelected: "Please select a date first.",
|
|
4342
|
+
noTimes: "No available times.",
|
|
4343
|
+
back: "Back"
|
|
4344
|
+
},
|
|
4345
|
+
tableSelector: {
|
|
4346
|
+
label: "Select available table(s):",
|
|
4347
|
+
table: "Table",
|
|
4348
|
+
max: "Max",
|
|
4349
|
+
noTables: "No specific tables available for this time/guest combination."
|
|
4350
|
+
}
|
|
4351
|
+
},
|
|
4352
|
+
fr: {
|
|
4353
|
+
reservationStepOne: {
|
|
4354
|
+
errors: {
|
|
4355
|
+
openingHoursNotSet: "Horaires non d\xE9finies.",
|
|
4356
|
+
clickHereToSet: "Cliquez ici pour d\xE9finir vos horaires."
|
|
4357
|
+
},
|
|
4358
|
+
modes: {
|
|
4359
|
+
withLimits: "Avec Limites",
|
|
4360
|
+
unlimited: "Illimit\xE9",
|
|
4361
|
+
openingHours: "Horaires",
|
|
4362
|
+
free: "Libre"
|
|
4363
|
+
},
|
|
4364
|
+
fields: {
|
|
4365
|
+
time: "Heure"
|
|
4366
|
+
},
|
|
4367
|
+
messages: {
|
|
4368
|
+
searchingTables: "Recherche de tables disponibles...",
|
|
4369
|
+
noTablesAvailable: "Aucune table sp\xE9cifique disponible pour cette s\xE9lection."
|
|
4370
|
+
},
|
|
4371
|
+
warnings: {
|
|
4372
|
+
unlimitedMode: "Illimit\xE9 ne tiendra pas compte des limites maximales."
|
|
4373
|
+
}
|
|
4374
|
+
},
|
|
4375
|
+
calendar: {
|
|
4376
|
+
selectDatePlaceholder: "S\xE9lectionnez une date",
|
|
4377
|
+
today: "Aujourd'hui",
|
|
4378
|
+
tomorrow: "Demain",
|
|
4379
|
+
prevWeek: "Semaine pr\xE9c\xE9dente",
|
|
4380
|
+
nextWeek: "Semaine suivante",
|
|
4381
|
+
dayHeaders: ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"],
|
|
4382
|
+
seatsQuestion: "Places ?"
|
|
4383
|
+
},
|
|
4384
|
+
timeSelector: {
|
|
4385
|
+
shifts: {
|
|
4386
|
+
breakfast: "Petit-d\xE9jeuner",
|
|
4387
|
+
lunch: "D\xE9jeuner",
|
|
4388
|
+
dinner: "D\xEEner"
|
|
4389
|
+
},
|
|
4390
|
+
selectMeal: "S\xE9lectionnez un repas",
|
|
4391
|
+
selectTime: "S\xE9lectionnez une heure",
|
|
4392
|
+
noDateSelected: "Veuillez d'abord s\xE9lectionner une date.",
|
|
4393
|
+
noTimes: "Aucun horaire disponible.",
|
|
4394
|
+
back: "Retour"
|
|
4395
|
+
},
|
|
4396
|
+
tableSelector: {
|
|
4397
|
+
label: "S\xE9lectionnez les table(s) disponibles :",
|
|
4398
|
+
table: "Table",
|
|
4399
|
+
max: "Max",
|
|
4400
|
+
noTables: "Aucune table sp\xE9cifique disponible pour cette combinaison temps/convives."
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
};
|
|
4404
|
+
|
|
4405
|
+
// src/components/ReservationStepOne/Calendar.js
|
|
4406
|
+
moment2.locale("nl");
|
|
4407
|
+
var Calendar = ({
|
|
4408
|
+
guests: guests2,
|
|
4409
|
+
selectedDate,
|
|
4410
|
+
onSelectDate,
|
|
4411
|
+
autoExpand,
|
|
4412
|
+
reservationMode,
|
|
4413
|
+
restaurantData,
|
|
4414
|
+
startDate,
|
|
4415
|
+
onWeekChange,
|
|
4416
|
+
reservations,
|
|
4417
|
+
giftcard,
|
|
4418
|
+
zitplaats
|
|
4419
|
+
}) => {
|
|
4420
|
+
const lang = localStorage.getItem("preferredLanguage") || "nl";
|
|
4421
|
+
const t = translations_default[lang].calendar;
|
|
4422
|
+
const [isExpanded, setIsExpanded] = useState(autoExpand || false);
|
|
4423
|
+
const [showAvailabilities, setShowAvailabilities] = useState(false);
|
|
4424
|
+
const calendarRef = useRef(null);
|
|
4425
|
+
const hideAvailTimerRef = useRef(null);
|
|
4426
|
+
const maxDate = moment2().tz("Europe/Amsterdam").add(1, "year").endOf("day");
|
|
4427
|
+
useEffect(() => {
|
|
4428
|
+
if (autoExpand) {
|
|
4429
|
+
setIsExpanded(true);
|
|
4430
|
+
}
|
|
4431
|
+
}, [autoExpand]);
|
|
4432
|
+
useEffect(() => {
|
|
4433
|
+
const handleClickOutside = (event) => {
|
|
4434
|
+
if (calendarRef.current && !calendarRef.current.contains(event.target)) {
|
|
4435
|
+
setIsExpanded(false);
|
|
4436
|
+
setShowAvailabilities(false);
|
|
4437
|
+
}
|
|
4438
|
+
};
|
|
4439
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
4440
|
+
return () => {
|
|
4441
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
4442
|
+
};
|
|
4443
|
+
}, []);
|
|
4444
|
+
useEffect(() => {
|
|
4445
|
+
return () => {
|
|
4446
|
+
if (hideAvailTimerRef.current) {
|
|
4447
|
+
clearTimeout(hideAvailTimerRef.current);
|
|
4448
|
+
hideAvailTimerRef.current = null;
|
|
4449
|
+
}
|
|
4450
|
+
};
|
|
4451
|
+
}, []);
|
|
4452
|
+
const showAvailabilityNow = () => {
|
|
4453
|
+
if (hideAvailTimerRef.current) {
|
|
4454
|
+
clearTimeout(hideAvailTimerRef.current);
|
|
4455
|
+
hideAvailTimerRef.current = null;
|
|
4456
|
+
}
|
|
4457
|
+
setShowAvailabilities(true);
|
|
4458
|
+
};
|
|
4459
|
+
const hideAvailabilityAfterDelay = (delay = 1e3) => {
|
|
4460
|
+
if (hideAvailTimerRef.current) {
|
|
4461
|
+
clearTimeout(hideAvailTimerRef.current);
|
|
4462
|
+
}
|
|
4463
|
+
hideAvailTimerRef.current = setTimeout(() => {
|
|
4464
|
+
setShowAvailabilities(false);
|
|
4465
|
+
hideAvailTimerRef.current = null;
|
|
4466
|
+
}, delay);
|
|
4467
|
+
};
|
|
4468
|
+
const computeMaxGuestsForDate = (date, today) => {
|
|
4469
|
+
if (date.isBefore(today, "day") || date.isAfter(maxDate, "day")) {
|
|
4470
|
+
return 0;
|
|
4471
|
+
}
|
|
4472
|
+
const formattedDate = date.format("YYYY-MM-DD");
|
|
4473
|
+
if (showAvailabilities) {
|
|
4474
|
+
const tableSettings2 = restaurantData?.["table-settings"] || {};
|
|
4475
|
+
const isTableAssignmentEnabled2 = tableSettings2.isInstalled === true && tableSettings2.assignmentMode === "automatic";
|
|
4476
|
+
let maxFittable2 = 0;
|
|
4477
|
+
for (let g = 1; g <= 21; g++) {
|
|
4478
|
+
let ok;
|
|
4479
|
+
if (isTableAssignmentEnabled2) {
|
|
4480
|
+
ok = isDateAvailableWithTableCheck(
|
|
4481
|
+
restaurantData,
|
|
4482
|
+
formattedDate,
|
|
4483
|
+
reservations,
|
|
4484
|
+
g,
|
|
4485
|
+
giftcard || null
|
|
4486
|
+
);
|
|
4487
|
+
} else {
|
|
4488
|
+
ok = isDateAvailable(
|
|
4489
|
+
restaurantData,
|
|
4490
|
+
formattedDate,
|
|
4491
|
+
reservations,
|
|
4492
|
+
g,
|
|
4493
|
+
giftcard || null
|
|
4494
|
+
);
|
|
4495
|
+
}
|
|
4496
|
+
if (ok) maxFittable2 = g;
|
|
4497
|
+
}
|
|
4498
|
+
return maxFittable2;
|
|
4499
|
+
}
|
|
4500
|
+
if (reservationMode === "vrije_keuze") {
|
|
4501
|
+
return 21;
|
|
4502
|
+
}
|
|
4503
|
+
if (reservationMode !== "met_limieten") {
|
|
4504
|
+
const open = isDateAvailable(
|
|
4505
|
+
restaurantData,
|
|
4506
|
+
formattedDate,
|
|
4507
|
+
reservations,
|
|
4508
|
+
-1e4,
|
|
4509
|
+
null
|
|
4510
|
+
);
|
|
4511
|
+
return open ? 21 : 0;
|
|
4512
|
+
}
|
|
4513
|
+
const tableSettings = restaurantData?.["table-settings"] || {};
|
|
4514
|
+
const isTableAssignmentEnabled = tableSettings.isInstalled === true && tableSettings.assignmentMode === "automatic" && reservationMode === "met_limieten";
|
|
4515
|
+
let maxFittable = 0;
|
|
4516
|
+
for (let g = 1; g <= 21; g++) {
|
|
4517
|
+
let ok;
|
|
4518
|
+
if (isTableAssignmentEnabled) {
|
|
4519
|
+
ok = isDateAvailableWithTableCheck(
|
|
4520
|
+
restaurantData,
|
|
4521
|
+
formattedDate,
|
|
4522
|
+
reservations,
|
|
4523
|
+
g,
|
|
4524
|
+
giftcard || null
|
|
4525
|
+
);
|
|
4526
|
+
} else {
|
|
4527
|
+
ok = isDateAvailable(
|
|
4528
|
+
restaurantData,
|
|
4529
|
+
formattedDate,
|
|
4530
|
+
reservations,
|
|
4531
|
+
g,
|
|
4532
|
+
giftcard || null
|
|
4533
|
+
);
|
|
4534
|
+
}
|
|
4535
|
+
if (ok) maxFittable = g;
|
|
4536
|
+
}
|
|
4537
|
+
return maxFittable;
|
|
4538
|
+
};
|
|
4539
|
+
const generateCalendarDays = (currentDate) => {
|
|
4540
|
+
const days2 = [];
|
|
4541
|
+
const today = moment2().tz("Europe/Amsterdam").startOf("day");
|
|
4542
|
+
const firstDayOfMonth = currentDate.clone().startOf("month");
|
|
4543
|
+
const lastDayOfMonth = currentDate.clone().endOf("month");
|
|
4544
|
+
const tableSettings = restaurantData?.["table-settings"] || {};
|
|
4545
|
+
const isTableAssignmentEnabled = tableSettings.isInstalled === true && tableSettings.assignmentMode === "automatic" && reservationMode === "met_limieten";
|
|
4546
|
+
let date = firstDayOfMonth.clone();
|
|
4547
|
+
while (date.isSameOrBefore(lastDayOfMonth, "day")) {
|
|
4548
|
+
const formattedDate = date.format("YYYY-MM-DD");
|
|
4549
|
+
let isAvailable;
|
|
4550
|
+
if (reservationMode === "vrije_keuze") {
|
|
4551
|
+
isAvailable = date.isBetween(today, maxDate, null, "[]");
|
|
4552
|
+
} else {
|
|
4553
|
+
const adjustedGuests = reservationMode !== "met_limieten" ? -1e4 : guests2;
|
|
4554
|
+
if (isTableAssignmentEnabled) {
|
|
4555
|
+
isAvailable = isDateAvailableWithTableCheck(
|
|
4556
|
+
restaurantData,
|
|
4557
|
+
formattedDate,
|
|
4558
|
+
reservations,
|
|
4559
|
+
adjustedGuests,
|
|
4560
|
+
reservationMode === "met_limieten" ? giftcard : null
|
|
4561
|
+
);
|
|
4562
|
+
} else {
|
|
4563
|
+
isAvailable = isDateAvailable(
|
|
4564
|
+
restaurantData,
|
|
4565
|
+
formattedDate,
|
|
4566
|
+
reservations,
|
|
4567
|
+
adjustedGuests,
|
|
4568
|
+
reservationMode === "met_limieten" ? giftcard : null
|
|
4569
|
+
);
|
|
4570
|
+
}
|
|
4571
|
+
}
|
|
4572
|
+
const maxGuestsAvailable = computeMaxGuestsForDate(date, today);
|
|
4573
|
+
days2.push({
|
|
4574
|
+
date: date.clone(),
|
|
4575
|
+
isPast: date.isBefore(today, "day"),
|
|
4576
|
+
isFuture: date.isAfter(maxDate, "day"),
|
|
4577
|
+
isAvailable,
|
|
4578
|
+
maxGuestsAvailable
|
|
4579
|
+
});
|
|
4580
|
+
date.add(1, "day");
|
|
4581
|
+
}
|
|
4582
|
+
return days2;
|
|
4583
|
+
};
|
|
4584
|
+
const handleDateClick = (day) => {
|
|
4585
|
+
if (day.isAvailable && !day.isPast && !day.isFuture) {
|
|
4586
|
+
onSelectDate(day.date.format("YYYY-MM-DD"));
|
|
4587
|
+
setIsExpanded(false);
|
|
4588
|
+
setShowAvailabilities(false);
|
|
4589
|
+
}
|
|
4590
|
+
};
|
|
4591
|
+
const handlePrevMonth = () => {
|
|
4592
|
+
const newStartDate = startDate.clone().subtract(1, "month").startOf("month");
|
|
4593
|
+
const today = moment2().tz("Europe/Amsterdam").startOf("day");
|
|
4594
|
+
if (newStartDate.clone().endOf("month").isBefore(today, "day")) {
|
|
4595
|
+
console.log("Cannot go to previous month. It is in the past.");
|
|
4596
|
+
return;
|
|
4597
|
+
}
|
|
4598
|
+
onWeekChange(newStartDate);
|
|
4599
|
+
};
|
|
4600
|
+
const handleNextMonth = () => {
|
|
4601
|
+
const newStartDate = startDate.clone().add(1, "month").startOf("month");
|
|
4602
|
+
onWeekChange(newStartDate);
|
|
4603
|
+
};
|
|
4604
|
+
const formatDisplayDate = () => {
|
|
4605
|
+
if (!selectedDate) {
|
|
4606
|
+
return t.selectDatePlaceholder;
|
|
4607
|
+
}
|
|
4608
|
+
const selectedMoment = moment2(selectedDate, "YYYY-MM-DD").tz("Europe/Amsterdam").startOf("day");
|
|
4609
|
+
const today = moment2().tz("Europe/Amsterdam").startOf("day");
|
|
4610
|
+
const tomorrow = today.clone().add(1, "day");
|
|
4611
|
+
if (selectedMoment.isSame(today, "day")) {
|
|
4612
|
+
return t.today;
|
|
4613
|
+
} else if (selectedMoment.isSame(tomorrow, "day")) {
|
|
4614
|
+
return t.tomorrow;
|
|
4615
|
+
} else {
|
|
4616
|
+
return selectedMoment.format("dddd D MMMM YYYY");
|
|
4617
|
+
}
|
|
4618
|
+
};
|
|
4619
|
+
const renderCalendarGrid = (days2) => {
|
|
4620
|
+
const firstDayOfMonth = startDate.clone().startOf("month");
|
|
4621
|
+
const dayOfWeek = firstDayOfMonth.day();
|
|
4622
|
+
const mondayStartDayOfWeek = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
|
|
4623
|
+
const calendarGrid = [];
|
|
4624
|
+
for (let i = 0; i < mondayStartDayOfWeek; i++) {
|
|
4625
|
+
calendarGrid.push(null);
|
|
4626
|
+
}
|
|
4627
|
+
calendarGrid.push(...days2);
|
|
4628
|
+
const totalCells = calendarGrid.length;
|
|
4629
|
+
const weeksNeeded = Math.ceil(totalCells / 7);
|
|
4630
|
+
while (calendarGrid.length < weeksNeeded * 7) {
|
|
4631
|
+
calendarGrid.push(null);
|
|
4632
|
+
}
|
|
4633
|
+
const weeks2 = [];
|
|
4634
|
+
for (let week = 0; week < weeksNeeded; week++) {
|
|
4635
|
+
const weekDays = calendarGrid.slice(week * 7, week * 7 + 7);
|
|
4636
|
+
weeks2.push(weekDays);
|
|
4637
|
+
}
|
|
4638
|
+
return weeks2;
|
|
4639
|
+
};
|
|
4640
|
+
const days = startDate ? generateCalendarDays(startDate) : [];
|
|
4641
|
+
const weeks = startDate ? renderCalendarGrid(days) : [];
|
|
4642
|
+
const dayHeaders = t.dayHeaders;
|
|
4643
|
+
const renderAvailabilityNumber = (value2) => {
|
|
4644
|
+
if (value2 >= 21) return "20+";
|
|
4645
|
+
return String(value2);
|
|
4646
|
+
};
|
|
4647
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "calendar-container", ref: calendarRef }, /* @__PURE__ */ React9.createElement(
|
|
4648
|
+
"div",
|
|
4649
|
+
{
|
|
4650
|
+
className: "calendar-display",
|
|
4651
|
+
onClick: () => setIsExpanded(!isExpanded)
|
|
4652
|
+
},
|
|
4653
|
+
/* @__PURE__ */ React9.createElement("span", null, formatDisplayDate()),
|
|
4654
|
+
/* @__PURE__ */ React9.createElement("span", { className: "arrow" }, /* @__PURE__ */ React9.createElement(
|
|
4655
|
+
"svg",
|
|
4656
|
+
{
|
|
4657
|
+
width: "12",
|
|
4658
|
+
height: "12",
|
|
4659
|
+
viewBox: "0 0 24 24",
|
|
4660
|
+
style: {
|
|
4661
|
+
transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
4662
|
+
transition: "transform 0.2s"
|
|
4663
|
+
}
|
|
4664
|
+
},
|
|
4665
|
+
/* @__PURE__ */ React9.createElement(
|
|
4666
|
+
"path",
|
|
4667
|
+
{
|
|
4668
|
+
d: "M7 10l5 5 5-5",
|
|
4669
|
+
fill: "none",
|
|
4670
|
+
stroke: "currentColor",
|
|
4671
|
+
strokeWidth: "2"
|
|
4672
|
+
}
|
|
4673
|
+
)
|
|
4674
|
+
))
|
|
4675
|
+
), isExpanded && startDate && /* @__PURE__ */ React9.createElement("div", { className: "calendar" }, /* @__PURE__ */ React9.createElement("div", { className: "calendar-header" }, /* @__PURE__ */ React9.createElement(
|
|
4676
|
+
"button",
|
|
4677
|
+
{
|
|
4678
|
+
type: "button",
|
|
4679
|
+
onClick: handlePrevMonth,
|
|
4680
|
+
"aria-label": t.prevWeek
|
|
4681
|
+
},
|
|
4682
|
+
"<"
|
|
4683
|
+
), /* @__PURE__ */ React9.createElement("span", null, startDate.format("MMMM YYYY")), /* @__PURE__ */ React9.createElement(
|
|
4684
|
+
"button",
|
|
4685
|
+
{
|
|
4686
|
+
type: "button",
|
|
4687
|
+
onClick: handleNextMonth,
|
|
4688
|
+
"aria-label": t.nextWeek
|
|
4689
|
+
},
|
|
4690
|
+
">"
|
|
4691
|
+
), /* @__PURE__ */ React9.createElement(
|
|
4692
|
+
"button",
|
|
4693
|
+
{
|
|
4694
|
+
type: "button",
|
|
4695
|
+
className: `availability-hold-btn ${showAvailabilities ? "active" : ""}`,
|
|
4696
|
+
"aria-pressed": showAvailabilities,
|
|
4697
|
+
"aria-label": "Houd ingedrukt om beschikbaarheden te tonen",
|
|
4698
|
+
onMouseDown: showAvailabilityNow,
|
|
4699
|
+
onMouseUp: () => hideAvailabilityAfterDelay(1e3),
|
|
4700
|
+
onMouseLeave: () => hideAvailabilityAfterDelay(1e3),
|
|
4701
|
+
onTouchStart: showAvailabilityNow,
|
|
4702
|
+
onTouchEnd: () => hideAvailabilityAfterDelay(1e3),
|
|
4703
|
+
onTouchCancel: () => hideAvailabilityAfterDelay(1e3),
|
|
4704
|
+
onKeyDown: (e) => {
|
|
4705
|
+
if (e.key === " " || e.key === "Enter") showAvailabilityNow();
|
|
4706
|
+
},
|
|
4707
|
+
onKeyUp: (e) => {
|
|
4708
|
+
if (e.key === " " || e.key === "Enter")
|
|
4709
|
+
hideAvailabilityAfterDelay(1e3);
|
|
4710
|
+
},
|
|
4711
|
+
style: {
|
|
4712
|
+
fontSize: "15px",
|
|
4713
|
+
color: "gray",
|
|
4714
|
+
fontWeight: "450",
|
|
4715
|
+
textDecoration: "underline"
|
|
4716
|
+
}
|
|
4717
|
+
},
|
|
4718
|
+
t.seatsQuestion
|
|
4719
|
+
)), /* @__PURE__ */ React9.createElement("div", { className: "calendar-weeks-wrapper" }, /* @__PURE__ */ React9.createElement("table", { className: "calendar-table" }, /* @__PURE__ */ React9.createElement("thead", null, /* @__PURE__ */ React9.createElement("tr", { translate: "no" }, dayHeaders.map((day, i) => /* @__PURE__ */ React9.createElement("th", { key: i }, day)))), /* @__PURE__ */ React9.createElement("tbody", null, weeks.map((week, weekIndex) => /* @__PURE__ */ React9.createElement("tr", { key: weekIndex, translate: "no" }, week.map((dayObj, dayIndex) => {
|
|
4720
|
+
if (!dayObj) {
|
|
4721
|
+
return /* @__PURE__ */ React9.createElement("td", { key: dayIndex, className: "empty-day" });
|
|
4722
|
+
}
|
|
4723
|
+
const isSelected = selectedDate && isSameDay(
|
|
4724
|
+
dayObj.date,
|
|
4725
|
+
moment2(selectedDate, "YYYY-MM-DD").tz(
|
|
4726
|
+
"Europe/Amsterdam"
|
|
4727
|
+
)
|
|
4728
|
+
);
|
|
4729
|
+
const classNames = [];
|
|
4730
|
+
if (dayObj.isPast) {
|
|
4731
|
+
classNames.push("gray-out");
|
|
4732
|
+
} else if (dayObj.isAvailable) {
|
|
4733
|
+
classNames.push("available");
|
|
4734
|
+
} else {
|
|
4735
|
+
classNames.push("unavailable");
|
|
4736
|
+
}
|
|
4737
|
+
if (isSelected) {
|
|
4738
|
+
classNames.push("selected");
|
|
4739
|
+
}
|
|
4740
|
+
return /* @__PURE__ */ React9.createElement(
|
|
4741
|
+
"td",
|
|
4742
|
+
{
|
|
4743
|
+
key: dayIndex,
|
|
4744
|
+
className: classNames.join(" "),
|
|
4745
|
+
onClick: () => handleDateClick(dayObj),
|
|
4746
|
+
style: {
|
|
4747
|
+
"--animation-order": dayIndex + weekIndex * 7
|
|
4748
|
+
}
|
|
4749
|
+
},
|
|
4750
|
+
/* @__PURE__ */ React9.createElement(
|
|
4751
|
+
"div",
|
|
4752
|
+
{
|
|
4753
|
+
className: `day-square ${showAvailabilities ? "showing-availabilities" : ""}`
|
|
4754
|
+
},
|
|
4755
|
+
/* @__PURE__ */ React9.createElement("span", { className: "day-number" }, showAvailabilities ? renderAvailabilityNumber(
|
|
4756
|
+
dayObj.maxGuestsAvailable
|
|
4757
|
+
) : dayObj.date.date())
|
|
4758
|
+
)
|
|
4759
|
+
);
|
|
4760
|
+
}))))))));
|
|
4761
|
+
};
|
|
4762
|
+
var Calendar_default = Calendar;
|
|
4763
|
+
|
|
4764
|
+
// src/components/ReservationStepOne/DateSelector.js
|
|
4765
|
+
var import_moment = __toESM(require_moment());
|
|
4766
|
+
var DateSelector = ({
|
|
4767
|
+
guests: guests2,
|
|
4768
|
+
formData,
|
|
4769
|
+
handleChange,
|
|
4770
|
+
resetFormDataFields,
|
|
4771
|
+
restaurantData,
|
|
4772
|
+
reservations,
|
|
4773
|
+
startDate,
|
|
4774
|
+
onWeekChange,
|
|
4775
|
+
reservationMode
|
|
4776
|
+
}) => {
|
|
4777
|
+
const handleDateSelect = (date) => {
|
|
4778
|
+
const formatted = (0, import_moment.default)(date).format("YYYY-MM-DD");
|
|
4779
|
+
console.log("Selected date:", formatted);
|
|
4780
|
+
handleChange({ target: { name: "date", value: formatted } });
|
|
4781
|
+
resetFormDataFields(["time"]);
|
|
4782
|
+
};
|
|
4783
|
+
const monthStartDate = startDate ? startDate.clone().startOf("month") : (0, import_moment.default)().startOf("month");
|
|
4784
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "form-group date-selector-container" }, /* @__PURE__ */ React9.createElement(
|
|
4785
|
+
Calendar_default,
|
|
4786
|
+
{
|
|
4787
|
+
guests: guests2,
|
|
4788
|
+
selectedDate: formData.date || null,
|
|
4789
|
+
onSelectDate: handleDateSelect,
|
|
4790
|
+
autoExpand: false,
|
|
4791
|
+
reservationMode,
|
|
4792
|
+
restaurantData,
|
|
4793
|
+
startDate: monthStartDate,
|
|
4794
|
+
onWeekChange,
|
|
4795
|
+
reservations,
|
|
4796
|
+
giftcard: formData.giftcard,
|
|
4797
|
+
zitplaats: formData.zitplaats
|
|
4798
|
+
}
|
|
4799
|
+
));
|
|
4800
|
+
};
|
|
4801
|
+
var DateSelector_default = DateSelector;
|
|
4802
|
+
|
|
4803
|
+
// src/components/ReservationStepOne/css/timeSelector.css
|
|
4804
|
+
styleInject(".new-reservation-page .time-selector-container {\n position: relative;\n}\n.new-reservation-page .time-display {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 10px;\n background-color: #fff;\n border: #ccc 1px solid;\n cursor: pointer;\n user-select: none;\n text-align: left;\n border-radius: 5px;\n}\n.new-reservation-page .time-display span:first-child {\n flex-grow: 1;\n}\n.new-reservation-page .time-selector {\n position: absolute;\n z-index: 1000;\n width: 100%;\n max-height: 300px;\n overflow-y: auto;\n background-color: rgba(255, 255, 255, 1);\n border: 1px solid #ccc;\n margin-top: 5px;\n padding: 10px;\n border-radius: 10px;\n animation: fadeInTimeSelector 0.3s ease-in-out;\n top: 75px;\n}\n@keyframes fadeInTimeSelector {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.new-reservation-page .time-period {\n margin-bottom: 15px;\n}\n.new-reservation-page .time-period-label {\n font-weight: bold;\n margin-bottom: 5px;\n}\n.new-reservation-page .time-options {\n display: flex;\n flex-wrap: wrap;\n gap: 5px;\n}\n.new-reservation-page .time-option {\n padding: 8px 12px;\n background-color: #ccffcc;\n color: #006600;\n border-radius: 5px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n}\n.new-reservation-page .time-option:hover {\n background-color: #b3ffb3;\n}\n.new-reservation-page .time-option.selected {\n background-color: #006600;\n color: #ccffcc;\n}\n.new-reservation-page .info-text {\n color: #666;\n font-style: italic;\n}\n.new-reservation-page .arrow {\n margin-left: auto;\n color: gray;\n display: flex;\n align-items: center;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .time-option {\n padding: 6px 10px;\n font-size: 14px;\n }\n}\n");
|
|
4805
|
+
var TimeSelector = ({
|
|
4806
|
+
guests: guests2,
|
|
4807
|
+
formData,
|
|
4808
|
+
handleChange,
|
|
4809
|
+
field,
|
|
4810
|
+
selectedDate,
|
|
4811
|
+
expanded,
|
|
4812
|
+
setCurrentExpandedField,
|
|
4813
|
+
restaurantData,
|
|
4814
|
+
reservations,
|
|
4815
|
+
reservationMode
|
|
4816
|
+
}) => {
|
|
4817
|
+
const lang = localStorage.getItem("preferredLanguage") || "nl";
|
|
4818
|
+
const t = translations_default[lang].timeSelector;
|
|
4819
|
+
const [isExpanded, setIsExpanded] = useState(expanded || false);
|
|
4820
|
+
const [availableTimes, setAvailableTimes] = useState([]);
|
|
4821
|
+
const [selectedMealPeriod, setSelectedMealPeriod] = useState(null);
|
|
4822
|
+
const timeSelectorRef = useRef(null);
|
|
4823
|
+
const shifts = {
|
|
4824
|
+
breakfast: { start: "07:00", end: "11:00", label: t.shifts.breakfast },
|
|
4825
|
+
lunch: { start: "11:00", end: "16:00", label: t.shifts.lunch },
|
|
4826
|
+
dinner: { start: "16:00", end: "23:00", label: t.shifts.dinner }
|
|
4827
|
+
};
|
|
4828
|
+
useEffect(() => {
|
|
4829
|
+
if (!selectedDate || !guests2) {
|
|
4830
|
+
setAvailableTimes([]);
|
|
4831
|
+
return;
|
|
4832
|
+
}
|
|
4833
|
+
if (reservationMode === "vrije_keuze") {
|
|
4834
|
+
if (selectedMealPeriod) {
|
|
4835
|
+
const shift = shifts[selectedMealPeriod];
|
|
4836
|
+
const start = DateTime.fromISO(`${selectedDate}T${shift.start}`, {
|
|
4837
|
+
zone: "Europe/Brussels"
|
|
4838
|
+
});
|
|
4839
|
+
const end = DateTime.fromISO(`${selectedDate}T${shift.end}`, {
|
|
4840
|
+
zone: "Europe/Brussels"
|
|
4841
|
+
});
|
|
4842
|
+
const times = [];
|
|
4843
|
+
let current = start;
|
|
4844
|
+
while (current < end) {
|
|
4845
|
+
times.push({
|
|
4846
|
+
value: current.toFormat("HH:mm"),
|
|
4847
|
+
label: current.toFormat("HH:mm")
|
|
4848
|
+
});
|
|
4849
|
+
current = current.plus({ minutes: 15 });
|
|
4850
|
+
}
|
|
4851
|
+
setAvailableTimes(times);
|
|
4852
|
+
} else {
|
|
4853
|
+
setAvailableTimes([]);
|
|
4854
|
+
}
|
|
4855
|
+
} else {
|
|
4856
|
+
if (restaurantData && reservations) {
|
|
4857
|
+
const adjustedGuests = reservationMode !== "met_limieten" ? -1e4 : guests2;
|
|
4858
|
+
const tableSettings = restaurantData?.["table-settings"] || {};
|
|
4859
|
+
const shouldUseTableFiltering = reservationMode === "met_limieten" && tableSettings.isInstalled === true && tableSettings.assignmentMode === "automatic";
|
|
4860
|
+
const selectedGiftcard = reservationMode === "met_limieten" ? formData.giftcard : null;
|
|
4861
|
+
const timeblocks = getAvailableTimeblocks(
|
|
4862
|
+
restaurantData,
|
|
4863
|
+
selectedDate,
|
|
4864
|
+
reservations,
|
|
4865
|
+
adjustedGuests,
|
|
4866
|
+
selectedGiftcard
|
|
4867
|
+
);
|
|
4868
|
+
const filtered = shouldUseTableFiltering ? getAvailableTimeblocksWithTableCheck(
|
|
4869
|
+
restaurantData,
|
|
4870
|
+
selectedDate,
|
|
4871
|
+
timeblocks,
|
|
4872
|
+
adjustedGuests,
|
|
4873
|
+
reservations
|
|
4874
|
+
) : timeblocks;
|
|
4875
|
+
const times = Object.keys(filtered).map((time) => ({
|
|
4876
|
+
value: time,
|
|
4877
|
+
label: filtered[time].name || time
|
|
4878
|
+
}));
|
|
4879
|
+
times.sort((a, b) => {
|
|
4880
|
+
const [aH, aM] = a.value.split(":").map(Number);
|
|
4881
|
+
const [bH, bM] = b.value.split(":").map(Number);
|
|
4882
|
+
return aH * 60 + aM - (bH * 60 + bM);
|
|
4883
|
+
});
|
|
4884
|
+
setAvailableTimes(times);
|
|
4885
|
+
if (formData[field.id] && !times.some((ti) => ti.value === formData[field.id])) {
|
|
4886
|
+
handleChange({ target: { name: field.id, value: "" } });
|
|
4887
|
+
}
|
|
4888
|
+
} else {
|
|
4889
|
+
setAvailableTimes([]);
|
|
4890
|
+
}
|
|
4891
|
+
}
|
|
4892
|
+
}, [
|
|
4893
|
+
selectedDate,
|
|
4894
|
+
guests2,
|
|
4895
|
+
restaurantData,
|
|
4896
|
+
reservations,
|
|
4897
|
+
reservationMode,
|
|
4898
|
+
field.id,
|
|
4899
|
+
selectedMealPeriod,
|
|
4900
|
+
// only track the specific time value (not the whole formData) to avoid seat-triggered reruns
|
|
4901
|
+
formData[field.id],
|
|
4902
|
+
handleChange
|
|
4903
|
+
]);
|
|
4904
|
+
useEffect(() => {
|
|
4905
|
+
if (reservationMode === "vrije_keuze") {
|
|
4906
|
+
setSelectedMealPeriod(null);
|
|
4907
|
+
if (formData[field.id]) {
|
|
4908
|
+
handleChange({ target: { name: field.id, value: "" } });
|
|
4909
|
+
}
|
|
4910
|
+
}
|
|
4911
|
+
}, [selectedDate, reservationMode]);
|
|
4912
|
+
const handleTimeSelect = (timeValue) => {
|
|
4913
|
+
handleChange({ target: { name: field.id, value: timeValue } });
|
|
4914
|
+
setIsExpanded(false);
|
|
4915
|
+
setCurrentExpandedField?.(null);
|
|
4916
|
+
};
|
|
4917
|
+
const handleMealPeriodSelect = (period) => {
|
|
4918
|
+
if (selectedMealPeriod !== period && formData[field.id]) {
|
|
4919
|
+
handleChange({ target: { name: field.id, value: "" } });
|
|
4920
|
+
}
|
|
4921
|
+
setSelectedMealPeriod(period);
|
|
4922
|
+
};
|
|
4923
|
+
const formatDisplayTime = () => {
|
|
4924
|
+
if (reservationMode === "vrije_keuze") {
|
|
4925
|
+
if (!selectedMealPeriod) {
|
|
4926
|
+
return t.selectMeal;
|
|
4927
|
+
}
|
|
4928
|
+
if (formData[field.id]) {
|
|
4929
|
+
return `${shifts[selectedMealPeriod].label} \u2013 ${formData[field.id]}`;
|
|
4930
|
+
}
|
|
4931
|
+
return `${shifts[selectedMealPeriod].label} \u2013 ${t.selectTime}`;
|
|
4932
|
+
} else {
|
|
4933
|
+
if (formData[field.id]) {
|
|
4934
|
+
const sel = availableTimes.find(
|
|
4935
|
+
(time) => time.value === formData[field.id]
|
|
4936
|
+
);
|
|
4937
|
+
return sel ? sel.label : t.selectTime;
|
|
4938
|
+
}
|
|
4939
|
+
return t.selectTime;
|
|
4940
|
+
}
|
|
4941
|
+
};
|
|
4942
|
+
if (!field) return null;
|
|
4943
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "form-group time-selector-container", ref: timeSelectorRef }, !selectedDate ? /* @__PURE__ */ React9.createElement("p", { className: "info-text" }, t.noDateSelected) : /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
4944
|
+
"div",
|
|
4945
|
+
{
|
|
4946
|
+
className: "time-display",
|
|
4947
|
+
onClick: () => {
|
|
4948
|
+
setIsExpanded(!isExpanded);
|
|
4949
|
+
if (!isExpanded) setCurrentExpandedField?.(field.id);
|
|
4950
|
+
}
|
|
4951
|
+
},
|
|
4952
|
+
/* @__PURE__ */ React9.createElement("span", null, formatDisplayTime()),
|
|
4953
|
+
/* @__PURE__ */ React9.createElement("span", { className: "arrow" }, /* @__PURE__ */ React9.createElement(
|
|
4954
|
+
"svg",
|
|
4955
|
+
{
|
|
4956
|
+
width: "12",
|
|
4957
|
+
height: "12",
|
|
4958
|
+
viewBox: "0 0 24 24",
|
|
4959
|
+
style: {
|
|
4960
|
+
transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
4961
|
+
transition: "transform 0.2s"
|
|
4962
|
+
}
|
|
4963
|
+
},
|
|
4964
|
+
/* @__PURE__ */ React9.createElement(
|
|
4965
|
+
"path",
|
|
4966
|
+
{
|
|
4967
|
+
d: "M7 10l5 5 5-5",
|
|
4968
|
+
fill: "none",
|
|
4969
|
+
stroke: "currentColor",
|
|
4970
|
+
strokeWidth: "2"
|
|
4971
|
+
}
|
|
4972
|
+
)
|
|
4973
|
+
))
|
|
4974
|
+
), isExpanded && /* @__PURE__ */ React9.createElement("div", { className: "time-selector" }, reservationMode === "vrije_keuze" ? selectedMealPeriod ? /* @__PURE__ */ React9.createElement("div", { className: "time-period" }, /* @__PURE__ */ React9.createElement("div", { className: "time-period-label" }, shifts[selectedMealPeriod].label, /* @__PURE__ */ React9.createElement(
|
|
4975
|
+
"button",
|
|
4976
|
+
{
|
|
4977
|
+
onClick: () => setSelectedMealPeriod(null),
|
|
4978
|
+
style: {
|
|
4979
|
+
marginLeft: "10px",
|
|
4980
|
+
background: "none",
|
|
4981
|
+
border: "none",
|
|
4982
|
+
cursor: "pointer",
|
|
4983
|
+
color: "#006600",
|
|
4984
|
+
fontSize: "0.9rem",
|
|
4985
|
+
padding: 0
|
|
4986
|
+
}
|
|
4987
|
+
},
|
|
4988
|
+
"\u2190 ",
|
|
4989
|
+
t.back
|
|
4990
|
+
)), /* @__PURE__ */ React9.createElement("div", { className: "time-options" }, availableTimes.length === 0 ? /* @__PURE__ */ React9.createElement("div", { className: "no-times" }, t.noTimes) : availableTimes.map((time) => /* @__PURE__ */ React9.createElement(
|
|
4991
|
+
"div",
|
|
4992
|
+
{
|
|
4993
|
+
key: time.value,
|
|
4994
|
+
className: `time-option ${formData[field.id] === time.value ? "selected" : ""}`,
|
|
4995
|
+
onClick: () => handleTimeSelect(time.value)
|
|
4996
|
+
},
|
|
4997
|
+
time.label
|
|
4998
|
+
)))) : /* @__PURE__ */ React9.createElement("div", { className: "time-options" }, Object.keys(shifts).map((period) => /* @__PURE__ */ React9.createElement(
|
|
4999
|
+
"div",
|
|
5000
|
+
{
|
|
5001
|
+
key: period,
|
|
5002
|
+
className: `time-option ${selectedMealPeriod === period ? "selected" : ""}`,
|
|
5003
|
+
onClick: () => handleMealPeriodSelect(period)
|
|
5004
|
+
},
|
|
5005
|
+
shifts[period].label
|
|
5006
|
+
))) : /* @__PURE__ */ React9.createElement("div", { className: "time-options" }, availableTimes.length === 0 ? /* @__PURE__ */ React9.createElement("div", { className: "no-times" }, t.noTimes) : availableTimes.map((time) => /* @__PURE__ */ React9.createElement(
|
|
5007
|
+
"div",
|
|
5008
|
+
{
|
|
5009
|
+
key: time.value,
|
|
5010
|
+
className: `time-option ${formData[field.id] === time.value ? "selected" : ""}`,
|
|
5011
|
+
onClick: () => handleTimeSelect(time.value)
|
|
5012
|
+
},
|
|
5013
|
+
time.label
|
|
5014
|
+
))))));
|
|
5015
|
+
};
|
|
5016
|
+
var TimeSelector_default = TimeSelector;
|
|
5017
|
+
|
|
5018
|
+
// src/components/ReservationStepOne/css/tableSelector.css
|
|
5019
|
+
styleInject(".new-reservation-page .table-selector-container {\n margin-top: 15px;\n padding: 10px;\n border: 1px solid #eee;\n border-radius: 4px;\n background-color: #f9f9f9;\n}\n.new-reservation-page .table-selector-label {\n display: block;\n margin-bottom: 10px;\n font-weight: bold;\n color: #333;\n font-size: 0.95rem;\n}\n.new-reservation-page .table-options {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n}\n.new-reservation-page .table-option {\n display: inline-block;\n margin-right: 15px;\n margin-bottom: 5px;\n padding: 5px 8px;\n border: 1px solid #ccc;\n border-radius: 4px;\n background-color: #fff;\n transition: background-color 0.2s ease;\n}\n.new-reservation-page .table-option label {\n display: flex;\n align-items: center;\n cursor: pointer;\n font-size: 0.9rem;\n color: #555;\n}\n.new-reservation-page .table-option input[type=checkbox] {\n margin-right: 8px;\n cursor: pointer;\n accent-color: var(--primary-color, #006600);\n}\n.new-reservation-page .table-option:has(input[type=checkbox]:checked) {\n background-color: #e0f2e0;\n border-color: #006600;\n}\n.new-reservation-page .table-option:hover {\n background-color: #f0f0f0;\n}\n.new-reservation-page .info-text {\n margin-top: 10px;\n font-size: 0.85rem;\n color: #666;\n}\n.new-reservation-page .selected-tables-info {\n margin-top: 10px;\n font-style: italic;\n}\n.new-reservation-page .info-text.loading-tables {\n font-style: italic;\n color: #006600;\n}\n");
|
|
5020
|
+
|
|
5021
|
+
// src/components/ReservationStepOne/TableSelector.js
|
|
5022
|
+
var TableSelector = ({
|
|
5023
|
+
availableTables = [],
|
|
5024
|
+
isFetching = false,
|
|
5025
|
+
formData = {},
|
|
5026
|
+
handleChange,
|
|
5027
|
+
setFormData
|
|
5028
|
+
// optional fallback if handleChange not provided
|
|
5029
|
+
}) => {
|
|
5030
|
+
const lang = localStorage.getItem("preferredLanguage") || "nl";
|
|
5031
|
+
const troot = translations_default?.[lang]?.tableSelector || {};
|
|
5032
|
+
const t = {
|
|
5033
|
+
label: troot.label || "Tafels",
|
|
5034
|
+
noTables: troot.noTables || "Geen tafels beschikbaar voor deze selectie.",
|
|
5035
|
+
table: troot.table || "Tafel",
|
|
5036
|
+
max: troot.max || "Max"
|
|
5037
|
+
};
|
|
5038
|
+
const selectedNumbers = Array.isArray(formData.selectedTableNumbers) ? formData.selectedTableNumbers : [];
|
|
5039
|
+
const selectedIds = Array.isArray(formData.selectedTableIds) ? formData.selectedTableIds : [];
|
|
5040
|
+
const updateSelection = (nextNums, nextIds) => {
|
|
5041
|
+
if (typeof handleChange === "function") {
|
|
5042
|
+
handleChange({
|
|
5043
|
+
target: {
|
|
5044
|
+
multiple: true,
|
|
5045
|
+
updates: {
|
|
5046
|
+
selectedTableNumbers: nextNums,
|
|
5047
|
+
selectedTableIds: nextIds
|
|
5048
|
+
}
|
|
5049
|
+
}
|
|
5050
|
+
});
|
|
5051
|
+
return;
|
|
5052
|
+
}
|
|
5053
|
+
if (typeof setFormData === "function") {
|
|
5054
|
+
setFormData((prev) => ({
|
|
5055
|
+
...prev,
|
|
5056
|
+
selectedTableNumbers: nextNums,
|
|
5057
|
+
selectedTableIds: nextIds
|
|
5058
|
+
}));
|
|
5059
|
+
}
|
|
5060
|
+
};
|
|
5061
|
+
const onToggle = (tableNumber) => (e) => {
|
|
5062
|
+
const checked = e.target.checked;
|
|
5063
|
+
const table = availableTables.find((t2) => t2.tableNumber === tableNumber);
|
|
5064
|
+
if (!table) return;
|
|
5065
|
+
let nextNums = [...selectedNumbers];
|
|
5066
|
+
let nextIds = [...selectedIds];
|
|
5067
|
+
if (checked) {
|
|
5068
|
+
if (!nextNums.includes(tableNumber)) nextNums.push(tableNumber);
|
|
5069
|
+
if (!nextIds.includes(table.tableId)) nextIds.push(table.tableId);
|
|
5070
|
+
} else {
|
|
5071
|
+
nextNums = nextNums.filter((n) => n !== tableNumber);
|
|
5072
|
+
nextIds = nextIds.filter((id) => id !== table.tableId);
|
|
5073
|
+
}
|
|
5074
|
+
nextNums.sort((a, b) => a - b);
|
|
5075
|
+
updateSelection(nextNums, nextIds);
|
|
5076
|
+
};
|
|
5077
|
+
if (isFetching) {
|
|
5078
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "form-group table-selector-container" }, /* @__PURE__ */ React9.createElement("label", { className: "table-selector-label" }, t.label), /* @__PURE__ */ React9.createElement("p", { className: "info-text" }, "Laden\u2026"));
|
|
5079
|
+
}
|
|
5080
|
+
if (!availableTables || availableTables.length === 0) {
|
|
5081
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "form-group table-selector-container" }, /* @__PURE__ */ React9.createElement("label", { className: "table-selector-label" }, t.label), /* @__PURE__ */ React9.createElement("p", { className: "info-text" }, t.noTables));
|
|
5082
|
+
}
|
|
5083
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "form-group table-selector-container" }, /* @__PURE__ */ React9.createElement("label", { className: "table-selector-label" }, t.label), /* @__PURE__ */ React9.createElement("div", { className: "table-options" }, availableTables.map((table) => {
|
|
5084
|
+
const number = table.tableNumber;
|
|
5085
|
+
const maxCapacity = table.maxCapacity ?? table.capacity ?? table.seats ?? "-";
|
|
5086
|
+
const checked = selectedNumbers.includes(number);
|
|
5087
|
+
return /* @__PURE__ */ React9.createElement("div", { key: `${table.tableId || number}`, className: "table-option" }, /* @__PURE__ */ React9.createElement("label", null, /* @__PURE__ */ React9.createElement(
|
|
5088
|
+
"input",
|
|
5089
|
+
{
|
|
5090
|
+
type: "checkbox",
|
|
5091
|
+
value: number,
|
|
5092
|
+
checked,
|
|
5093
|
+
onChange: onToggle(number)
|
|
5094
|
+
}
|
|
5095
|
+
), t.table, " ", number, " (", t.max, ": ", maxCapacity, ")"));
|
|
5096
|
+
})));
|
|
5097
|
+
};
|
|
5098
|
+
var TableSelector_default = TableSelector;
|
|
5099
|
+
|
|
4155
5100
|
// src/components/ReservationStepOne/css/reservationMode.css
|
|
4156
5101
|
styleInject(".new-reservation-page .form-row .field-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.new-reservation-page .form-row .reservation-mode-buttons {\n margin-top: 0;\n}\n.new-reservation-page .reservation-mode-buttons {\n display: flex;\n gap: 10px;\n margin-top: 10px;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 1;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: var(--border-radius);\n background-color: var(--color-white);\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s ease, color 0.3s ease;\n}\n.new-reservation-page .reservation-mode-button.active,\n.new-reservation-page .reservation-mode-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .reservation-modes-container {\n display: flex;\n flex-wrap: wrap;\n margin: 0 -5px;\n width: 100%;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 0 0 calc(50% - 10px);\n margin: 5px;\n padding: 10px;\n box-sizing: border-box;\n text-align: center;\n border: 1px solid #ccc;\n background: #f7f7f7;\n cursor: pointer;\n}\n.new-reservation-page .reservation-mode-button:nth-child(3) {\n flex: 0 0 100%;\n}\n.new-reservation-page .reservation-modes-container {\n display: flex;\n flex-wrap: wrap;\n margin: 0 -5px;\n width: 100%;\n}\n.new-reservation-page .reservation-mode-button {\n flex: 0 0 calc(50% - 10px);\n margin: 5px;\n padding: 10px;\n box-sizing: border-box;\n text-align: center;\n border: 1px solid #ccc;\n background: #f7f7f7;\n cursor: pointer;\n}\n.new-reservation-page .reservation-mode-button.active,\n.new-reservation-page .reservation-mode-button:hover {\n background-color: var(--color-blue);\n color: var(--color-white);\n}\n.new-reservation-page .unlimited-mode-warning {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n margin: 15px 0;\n padding: 12px 15px;\n background-color: #fff3cd;\n border: 1px solid #ffeaa7;\n border-radius: var(--border-radius, 4px);\n border-left: 4px solid #e67e22;\n font-size: 0.9rem;\n line-height: 1.4;\n}\n.new-reservation-page .unlimited-mode-warning .warning-icon {\n color: #e67e22;\n font-size: 1.1rem;\n margin-top: 2px;\n flex-shrink: 0;\n}\n.new-reservation-page .unlimited-mode-warning .warning-text {\n color: #856404;\n margin: 0;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .unlimited-mode-warning {\n margin: 10px 0;\n padding: 10px 12px;\n font-size: 0.85rem;\n }\n .new-reservation-page .unlimited-mode-warning .warning-icon {\n font-size: 1rem;\n }\n}\n.new-reservation-page .reservation-sidebar-component {\n position: fixed;\n top: 0;\n right: -400px;\n width: 400px;\n height: 100%;\n background-color: #fff;\n box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);\n z-index: var(--z-index-sidebar-reservation);\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n transition: right 0.3s ease-in-out;\n}\n.new-reservation-page .admin-title {\n text-align: center;\n margin-bottom: 30px;\n}\n.new-reservation-page .reservation-sidebar-component.open {\n right: 0;\n}\n.new-reservation-page .reservation-sidebar-content {\n padding: 20px;\n padding-top: 60px;\n}\n.new-reservation-page .close-sidebar-button {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: transparent;\n border: none;\n cursor: pointer;\n}\n.new-reservation-page .close-sidebar-button svg {\n color: #000;\n}\n.new-reservation-page .sidebar-section-one,\n.new-reservation-page .sidebar-section-two {\n margin-bottom: 20px;\n}\n.new-reservation-page .reservation-footer {\n margin-top: auto;\n}\n.new-reservation-page .store-reservation-button {\n width: 100%;\n padding: 12px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1.1rem;\n}\n.new-reservation-page .open-sidebar-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: var(--color-blue);\n color: #fff;\n border: none;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n cursor: pointer;\n z-index: var(--z-index-modal) !important;\n transition: all 0.3s ease;\n}\n.new-reservation-page .open-sidebar-button:hover {\n background-color: var(--color-blue-hover-accent) !important;\n}\n.new-reservation-page .open-sidebar-button svg {\n position: relative;\n top: 2px;\n}\n@media screen and (max-width: 480px) {\n .new-reservation-page .reservation-sidebar-component {\n width: 100%;\n }\n}\n.new-reservation-page .sidebar-section-personeel {\n margin-bottom: 10px;\n}\n");
|
|
4157
5102
|
|
|
4158
|
-
// src/components/ReservationStepOne/
|
|
5103
|
+
// src/components/ReservationStepOne/index.js
|
|
5104
|
+
var import_moment2 = __toESM(require_moment());
|
|
5105
|
+
var useApi = () => {
|
|
5106
|
+
const getJwtToken = useCallback(() => {
|
|
5107
|
+
return localStorage.getItem("accessToken");
|
|
5108
|
+
}, []);
|
|
5109
|
+
const get = useCallback(
|
|
5110
|
+
(endpoint, config = {}) => {
|
|
5111
|
+
const { params, ...axiosConfig } = config;
|
|
5112
|
+
const token = getJwtToken();
|
|
5113
|
+
return axios.get(endpoint, {
|
|
5114
|
+
...axiosConfig,
|
|
5115
|
+
params,
|
|
5116
|
+
headers: {
|
|
5117
|
+
...axiosConfig.headers,
|
|
5118
|
+
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
5119
|
+
}
|
|
5120
|
+
}).then((response) => response.data).catch((error) => {
|
|
5121
|
+
console.error("Error fetching data:", error);
|
|
5122
|
+
throw error;
|
|
5123
|
+
});
|
|
5124
|
+
},
|
|
5125
|
+
[getJwtToken]
|
|
5126
|
+
);
|
|
5127
|
+
const mutate = useCallback(
|
|
5128
|
+
(method, endpoint, data = null, config = {}) => {
|
|
5129
|
+
const token = getJwtToken();
|
|
5130
|
+
return axios({
|
|
5131
|
+
method,
|
|
5132
|
+
url: endpoint,
|
|
5133
|
+
data,
|
|
5134
|
+
...config,
|
|
5135
|
+
headers: {
|
|
5136
|
+
...config.headers,
|
|
5137
|
+
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
5138
|
+
}
|
|
5139
|
+
}).then((response) => response.data).catch((error) => {
|
|
5140
|
+
console.error(`Error with ${method} request:`, error);
|
|
5141
|
+
throw error;
|
|
5142
|
+
});
|
|
5143
|
+
},
|
|
5144
|
+
[getJwtToken]
|
|
5145
|
+
);
|
|
5146
|
+
const apiMethods = useMemo(
|
|
5147
|
+
() => ({
|
|
5148
|
+
get,
|
|
5149
|
+
post: (endpoint, data, config) => mutate("POST", endpoint, data, config),
|
|
5150
|
+
put: (endpoint, data, config) => mutate("PUT", endpoint, data, config),
|
|
5151
|
+
patch: (endpoint, data, config) => mutate("PATCH", endpoint, data, config),
|
|
5152
|
+
delete: (endpoint, config) => mutate("DELETE", endpoint, null, config)
|
|
5153
|
+
}),
|
|
5154
|
+
[get, mutate]
|
|
5155
|
+
);
|
|
5156
|
+
return apiMethods;
|
|
5157
|
+
};
|
|
5158
|
+
var useApi_default = useApi;
|
|
4159
5159
|
var ReservationStepOne = ({
|
|
4160
5160
|
formData,
|
|
4161
5161
|
errors,
|
|
4162
5162
|
handleChange,
|
|
5163
|
+
handleStepOneSubmit,
|
|
4163
5164
|
setFormData,
|
|
4164
5165
|
timeblocks,
|
|
4165
5166
|
loadingTimeblocks,
|
|
4166
5167
|
timeblocksError,
|
|
4167
|
-
restaurantData
|
|
4168
|
-
reservations = []
|
|
5168
|
+
restaurantData
|
|
4169
5169
|
}) => {
|
|
5170
|
+
const lang = localStorage.getItem("preferredLanguage") || "nl";
|
|
5171
|
+
const t = translations_default[lang].reservationStepOne;
|
|
5172
|
+
const [guests2, setGuests] = useState(formData.guests || 2);
|
|
5173
|
+
const [startDate, setStartDate] = useState(null);
|
|
5174
|
+
const [reservations, setReservations] = useState([]);
|
|
5175
|
+
const api = useApi_default();
|
|
4170
5176
|
const [availableTables, setAvailableTables] = useState([]);
|
|
4171
5177
|
const [isFetchingTables, setIsFetchingTables] = useState(false);
|
|
5178
|
+
const initializationDone = useRef(false);
|
|
5179
|
+
const resetFormDataFields = useCallback(
|
|
5180
|
+
(fieldsToReset) => {
|
|
5181
|
+
setFormData((prevFormData) => {
|
|
5182
|
+
const newFormData = { ...prevFormData };
|
|
5183
|
+
fieldsToReset.forEach((field) => {
|
|
5184
|
+
newFormData[field] = "";
|
|
5185
|
+
});
|
|
5186
|
+
if (fieldsToReset.includes("date") || fieldsToReset.includes("time") || fieldsToReset.includes("guests")) {
|
|
5187
|
+
newFormData.selectedTableNumbers = [];
|
|
5188
|
+
newFormData.selectedTableIds = [];
|
|
5189
|
+
setAvailableTables([]);
|
|
5190
|
+
}
|
|
5191
|
+
return newFormData;
|
|
5192
|
+
});
|
|
5193
|
+
},
|
|
5194
|
+
[setFormData]
|
|
5195
|
+
);
|
|
5196
|
+
useEffect(() => {
|
|
5197
|
+
const today = (0, import_moment2.default)().tz("Europe/Amsterdam").startOf("day");
|
|
5198
|
+
let firstWeekStart = today.clone().startOf("isoWeek");
|
|
5199
|
+
while (isWeekInPast(firstWeekStart)) {
|
|
5200
|
+
firstWeekStart.add(1, "week");
|
|
5201
|
+
}
|
|
5202
|
+
setStartDate(firstWeekStart);
|
|
5203
|
+
}, []);
|
|
5204
|
+
useEffect(() => {
|
|
5205
|
+
const fetchReservations = async () => {
|
|
5206
|
+
if (startDate && (formData.reservationMode === "met_limieten" || formData.reservationMode === "zonder_regels")) {
|
|
5207
|
+
const tableSettings2 = restaurantData?.["table-settings"] || {};
|
|
5208
|
+
const isAutomaticAssignment = tableSettings2.isInstalled === true && tableSettings2.assignmentMode === "automatic";
|
|
5209
|
+
if (formData.reservationMode === "met_limieten" || formData.reservationMode === "zonder_regels" && isAutomaticAssignment) {
|
|
5210
|
+
const beginDate = startDate.format("YYYY-MM-DD");
|
|
5211
|
+
const endDate = startDate.clone().add(13, "days").format("YYYY-MM-DD");
|
|
5212
|
+
const restaurantId = localStorage.getItem("username");
|
|
5213
|
+
const endpoint = `${window.baseDomain}api/slots/${restaurantId}/${beginDate}/${endDate}`;
|
|
5214
|
+
try {
|
|
5215
|
+
const data = await api.get(endpoint, { noCache: true });
|
|
5216
|
+
setReservations(data || []);
|
|
5217
|
+
} catch (error) {
|
|
5218
|
+
console.error("Error fetching reservations:", error);
|
|
5219
|
+
setReservations([]);
|
|
5220
|
+
}
|
|
5221
|
+
} else {
|
|
5222
|
+
setReservations([]);
|
|
5223
|
+
}
|
|
5224
|
+
} else {
|
|
5225
|
+
setReservations([]);
|
|
5226
|
+
}
|
|
5227
|
+
};
|
|
5228
|
+
fetchReservations();
|
|
5229
|
+
}, [startDate, api, formData.reservationMode, restaurantData]);
|
|
5230
|
+
const handleWeekChange = (newStartDate) => {
|
|
5231
|
+
setStartDate(newStartDate);
|
|
5232
|
+
resetFormDataFields([
|
|
5233
|
+
"date",
|
|
5234
|
+
"time",
|
|
5235
|
+
"selectedTableNumbers",
|
|
5236
|
+
"selectedTableIds"
|
|
5237
|
+
]);
|
|
5238
|
+
};
|
|
5239
|
+
useEffect(() => {
|
|
5240
|
+
if (!initializationDone.current) {
|
|
5241
|
+
let needsUpdate = false;
|
|
5242
|
+
const updates = {};
|
|
5243
|
+
if (!formData.reservationMode) {
|
|
5244
|
+
updates.reservationMode = "met_limieten";
|
|
5245
|
+
needsUpdate = true;
|
|
5246
|
+
}
|
|
5247
|
+
if (!formData.guests || formData.guests === "") {
|
|
5248
|
+
updates.guests = guests2;
|
|
5249
|
+
needsUpdate = true;
|
|
5250
|
+
}
|
|
5251
|
+
if (!Array.isArray(formData.selectedTableNumbers)) {
|
|
5252
|
+
updates.selectedTableNumbers = [];
|
|
5253
|
+
needsUpdate = true;
|
|
5254
|
+
}
|
|
5255
|
+
if (!Array.isArray(formData.selectedTableIds)) {
|
|
5256
|
+
updates.selectedTableIds = [];
|
|
5257
|
+
needsUpdate = true;
|
|
5258
|
+
}
|
|
5259
|
+
if (needsUpdate) {
|
|
5260
|
+
setTimeout(() => {
|
|
5261
|
+
handleChange({ target: { multiple: true, updates } });
|
|
5262
|
+
}, 0);
|
|
5263
|
+
initializationDone.current = true;
|
|
5264
|
+
} else {
|
|
5265
|
+
initializationDone.current = true;
|
|
5266
|
+
}
|
|
5267
|
+
}
|
|
5268
|
+
}, [
|
|
5269
|
+
formData.reservationMode,
|
|
5270
|
+
formData.guests,
|
|
5271
|
+
formData.selectedTableNumbers,
|
|
5272
|
+
formData.selectedTableIds,
|
|
5273
|
+
guests2,
|
|
5274
|
+
handleChange
|
|
5275
|
+
]);
|
|
4172
5276
|
useEffect(() => {
|
|
4173
5277
|
const tableSettings2 = restaurantData?.["table-settings"] || {};
|
|
4174
5278
|
const isAutomaticAssignment = tableSettings2.isInstalled === true && tableSettings2.assignmentMode === "automatic";
|
|
@@ -4231,44 +5335,165 @@ var ReservationStepOne = ({
|
|
|
4231
5335
|
formData.guests,
|
|
4232
5336
|
restaurantData,
|
|
4233
5337
|
reservations,
|
|
5338
|
+
formData.reservationMode,
|
|
4234
5339
|
formData.selectedTableNumbers,
|
|
4235
5340
|
formData.selectedTableIds,
|
|
4236
5341
|
handleChange
|
|
4237
5342
|
]);
|
|
5343
|
+
const handleGuestChange = (event) => {
|
|
5344
|
+
const newGuestCount = parseInt(event.target.value, 10) || 1;
|
|
5345
|
+
setGuests(newGuestCount);
|
|
5346
|
+
handleChange(event);
|
|
5347
|
+
resetFormDataFields(["time", "selectedTableNumbers", "selectedTableIds"]);
|
|
5348
|
+
};
|
|
5349
|
+
useEffect(() => {
|
|
5350
|
+
resetFormDataFields([
|
|
5351
|
+
"date",
|
|
5352
|
+
"time",
|
|
5353
|
+
"selectedTableNumbers",
|
|
5354
|
+
"selectedTableIds"
|
|
5355
|
+
]);
|
|
5356
|
+
}, [formData.reservationMode, resetFormDataFields]);
|
|
5357
|
+
const handleTopLevelSelection = (mode) => {
|
|
5358
|
+
if (mode === "met_limieten") {
|
|
5359
|
+
handleChange({
|
|
5360
|
+
target: { name: "reservationMode", value: "met_limieten" }
|
|
5361
|
+
});
|
|
5362
|
+
} else if (mode === "onbeperkt_parent") {
|
|
5363
|
+
if (!["zonder_regels", "vrije_keuze"].includes(formData.reservationMode)) {
|
|
5364
|
+
handleChange({
|
|
5365
|
+
target: { name: "reservationMode", value: "zonder_regels" }
|
|
5366
|
+
});
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
};
|
|
5370
|
+
const handleSubSelection = (mode) => {
|
|
5371
|
+
handleChange({ target: { name: "reservationMode", value: mode } });
|
|
5372
|
+
};
|
|
5373
|
+
const currentMode = formData.reservationMode;
|
|
5374
|
+
const isFinalMode = ["met_limieten", "zonder_regels", "vrije_keuze"].includes(
|
|
5375
|
+
currentMode
|
|
5376
|
+
);
|
|
5377
|
+
const tableSettings = restaurantData?.["table-settings"] || {};
|
|
5378
|
+
const showTableSelector = isFinalMode && formData.date && formData.time && formData.guests > 0 && tableSettings.isInstalled === true && tableSettings.assignmentMode === "automatic" && availableTables.length > 0;
|
|
5379
|
+
const seatSelectionEnabled = !!restaurantData?.["general-settings"]?.seatSelectionEnabled;
|
|
5380
|
+
const seatOptions = ["Terras", "Restaurant"];
|
|
5381
|
+
const handleSeatPick = (seat) => {
|
|
5382
|
+
setFormData((prev) => ({ ...prev, zitplaats: seat }));
|
|
5383
|
+
};
|
|
4238
5384
|
if (timeblocksError) {
|
|
4239
|
-
return /* @__PURE__ */
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
5385
|
+
return /* @__PURE__ */ React9.createElement("div", null, t.errors.openingHoursNotSet, " ", /* @__PURE__ */ React9.createElement(
|
|
5386
|
+
"a",
|
|
5387
|
+
{
|
|
5388
|
+
href: "https://happychef.cloud/#/openinghours/dinner",
|
|
5389
|
+
target: "_blank",
|
|
5390
|
+
rel: "noopener noreferrer",
|
|
5391
|
+
style: { color: "var(--color-blue)", textDecoration: "underline" }
|
|
5392
|
+
},
|
|
5393
|
+
t.errors.clickHereToSet
|
|
5394
|
+
));
|
|
4243
5395
|
}
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
return /* @__PURE__ */ React.createElement("div", { className: "reservation-step-one-placeholder" }, /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("strong", null, "Note:"), " This is a simplified ReservationStepOne component."), /* @__PURE__ */ React.createElement("p", null, "Uses @happychef/algorithm to calculate available tables based on restaurant data, date, time, guests, and existing reservations."), /* @__PURE__ */ React.createElement("p", null, "Current form data:"), /* @__PURE__ */ React.createElement("ul", null, /* @__PURE__ */ React.createElement("li", null, "Guests: ", formData.guests), /* @__PURE__ */ React.createElement("li", null, "Date: ", formData.date || "Not selected"), /* @__PURE__ */ React.createElement("li", null, "Time: ", formData.time || "Not selected"), /* @__PURE__ */ React.createElement("li", null, "Available tables: ", availableTables.length), isFetchingTables && /* @__PURE__ */ React.createElement("li", null, "Calculating availability...")), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, "Guests:", /* @__PURE__ */ React.createElement(
|
|
4247
|
-
"input",
|
|
5396
|
+
return /* @__PURE__ */ React9.createElement("form", { className: "account-manage-form", noValidate: true }, /* @__PURE__ */ React9.createElement("div", { className: "form-group reservation-mode" }, /* @__PURE__ */ React9.createElement("div", { className: "reservation-modes-container" }, /* @__PURE__ */ React9.createElement(
|
|
5397
|
+
"button",
|
|
4248
5398
|
{
|
|
4249
|
-
type: "
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
5399
|
+
type: "button",
|
|
5400
|
+
className: `reservation-mode-button ${currentMode === "met_limieten" ? "active" : ""}`,
|
|
5401
|
+
onClick: () => handleTopLevelSelection("met_limieten"),
|
|
5402
|
+
"aria-pressed": currentMode === "met_limieten"
|
|
5403
|
+
},
|
|
5404
|
+
t.modes.withLimits
|
|
5405
|
+
), /* @__PURE__ */ React9.createElement(
|
|
5406
|
+
"button",
|
|
5407
|
+
{
|
|
5408
|
+
type: "button",
|
|
5409
|
+
className: `reservation-mode-button ${["onbeperkt_parent", "zonder_regels", "vrije_keuze"].includes(
|
|
5410
|
+
currentMode
|
|
5411
|
+
) ? "active" : ""}`,
|
|
5412
|
+
onClick: () => handleTopLevelSelection("onbeperkt_parent"),
|
|
5413
|
+
"aria-pressed": [
|
|
5414
|
+
"onbeperkt_parent",
|
|
5415
|
+
"zonder_regels",
|
|
5416
|
+
"vrije_keuze"
|
|
5417
|
+
].includes(currentMode)
|
|
5418
|
+
},
|
|
5419
|
+
t.modes.unlimited
|
|
5420
|
+
)), ["onbeperkt_parent", "zonder_regels", "vrije_keuze"].includes(
|
|
5421
|
+
currentMode
|
|
5422
|
+
) && /* @__PURE__ */ React9.createElement("div", { className: "reservation-modes-container sub-modes" }, /* @__PURE__ */ React9.createElement(
|
|
5423
|
+
"button",
|
|
5424
|
+
{
|
|
5425
|
+
type: "button",
|
|
5426
|
+
className: `reservation-mode-button ${currentMode === "zonder_regels" ? "active" : ""}`,
|
|
5427
|
+
onClick: () => handleSubSelection("zonder_regels"),
|
|
5428
|
+
"aria-pressed": currentMode === "zonder_regels"
|
|
5429
|
+
},
|
|
5430
|
+
t.modes.openingHours
|
|
5431
|
+
), /* @__PURE__ */ React9.createElement(
|
|
5432
|
+
"button",
|
|
5433
|
+
{
|
|
5434
|
+
type: "button",
|
|
5435
|
+
className: `reservation-mode-button ${currentMode === "vrije_keuze" ? "active" : ""}`,
|
|
5436
|
+
onClick: () => handleSubSelection("vrije_keuze"),
|
|
5437
|
+
"aria-pressed": currentMode === "vrije_keuze"
|
|
5438
|
+
},
|
|
5439
|
+
t.modes.free
|
|
5440
|
+
))), ["onbeperkt_parent", "zonder_regels", "vrije_keuze"].includes(
|
|
5441
|
+
currentMode
|
|
5442
|
+
) && /* @__PURE__ */ React9.createElement("div", { className: "unlimited-mode-warning" }, /* @__PURE__ */ React9.createElement("div", { className: "warning-text" }, t.warnings?.unlimitedMode || (lang === "nl" ? "Let op: Bij onbeperkte boekingen wordt geen rekening gehouden met de maximale capaciteit van het restaurant. De maximale zitplaatslimiet kan worden overschreden." : "Warning: Unlimited bookings do not take into account the restaurant's maximum capacity. The maximum seating limit may be exceeded."))), /* @__PURE__ */ React9.createElement(
|
|
5443
|
+
ValueSelector_default,
|
|
5444
|
+
{
|
|
5445
|
+
setGuests,
|
|
5446
|
+
value: formData.guests || guests2,
|
|
5447
|
+
onChange: handleGuestChange,
|
|
5448
|
+
error: errors.guests
|
|
4254
5449
|
}
|
|
4255
|
-
)
|
|
4256
|
-
|
|
5450
|
+
), isFinalMode && formData.guests > 0 && /* @__PURE__ */ React9.createElement(
|
|
5451
|
+
DateSelector_default,
|
|
4257
5452
|
{
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
5453
|
+
guests: formData.guests,
|
|
5454
|
+
formData,
|
|
5455
|
+
handleChange,
|
|
5456
|
+
resetFormDataFields,
|
|
5457
|
+
restaurantData,
|
|
5458
|
+
reservations,
|
|
5459
|
+
startDate,
|
|
5460
|
+
onWeekChange: handleWeekChange,
|
|
5461
|
+
reservationMode: currentMode
|
|
4262
5462
|
}
|
|
4263
|
-
)
|
|
4264
|
-
|
|
5463
|
+
), isFinalMode && formData.date && /* @__PURE__ */ React9.createElement(
|
|
5464
|
+
TimeSelector_default,
|
|
4265
5465
|
{
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
5466
|
+
guests: formData.guests,
|
|
5467
|
+
formData,
|
|
5468
|
+
handleChange,
|
|
5469
|
+
field: { id: "time", label: t.fields.time },
|
|
5470
|
+
selectedDate: formData.date,
|
|
5471
|
+
setCurrentExpandedField: () => {
|
|
5472
|
+
},
|
|
5473
|
+
restaurantData,
|
|
5474
|
+
reservations,
|
|
5475
|
+
reservationMode: currentMode
|
|
4270
5476
|
}
|
|
4271
|
-
)
|
|
5477
|
+
), seatSelectionEnabled && /* @__PURE__ */ React9.createElement("div", { className: "form-row", style: { marginTop: 12 } }, /* @__PURE__ */ React9.createElement("div", { className: "reservation-mode-buttons" }, seatOptions.map((opt) => /* @__PURE__ */ React9.createElement(
|
|
5478
|
+
"button",
|
|
5479
|
+
{
|
|
5480
|
+
key: opt,
|
|
5481
|
+
type: "button",
|
|
5482
|
+
className: `reservation-mode-button ${formData.zitplaats === opt ? "active" : ""}`,
|
|
5483
|
+
onClick: () => handleSeatPick(opt),
|
|
5484
|
+
"aria-pressed": formData.zitplaats === opt
|
|
5485
|
+
},
|
|
5486
|
+
opt
|
|
5487
|
+
))), errors.zitplaats && /* @__PURE__ */ React9.createElement("small", { className: "error" }, errors.zitplaats)), showTableSelector && /* @__PURE__ */ React9.createElement(
|
|
5488
|
+
TableSelector_default,
|
|
5489
|
+
{
|
|
5490
|
+
availableTables,
|
|
5491
|
+
isFetching: isFetchingTables,
|
|
5492
|
+
formData,
|
|
5493
|
+
setFormData,
|
|
5494
|
+
handleChange
|
|
5495
|
+
}
|
|
5496
|
+
));
|
|
4272
5497
|
};
|
|
4273
5498
|
var ReservationStepOne_default = ReservationStepOne;
|
|
4274
5499
|
|
|
@@ -4286,7 +5511,7 @@ var getSection = (translationsObj, sectionKey, fallbackLang = "nl") => {
|
|
|
4286
5511
|
var magicAnimation_default = { v: "5.12.1", fr: 30, ip: 0, op: 530, w: 1024, h: 900, nm: "gr1", ddd: 0, assets: [], layers: [{ ddd: 0, ind: 1, ty: 4, nm: "Layer 6", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 1, k: [{ i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 25, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 145, s: [-9] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 265, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 385, s: [9] }, { t: 505, s: [0] }], ix: 10 }, p: { a: 0, k: [1206.514, -59.851, 0], ix: 2, l: 2 }, a: { a: 0, k: [0, 0, 0], ix: 1, l: 2 }, s: { a: 1, k: [{ i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 25, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 145, s: [134.764, 134.764, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 265, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 385, s: [134.764, 134.764, 100] }, { t: 505, s: [100, 100, 100] }], ix: 6, l: 2 } }, ao: 0, ef: [{ ty: 29, nm: "Gaussian Blur", np: 5, mn: "ADBE Gaussian Blur 2", ix: 1, en: 1, ef: [{ ty: 0, nm: "Blurriness", mn: "ADBE Gaussian Blur 2-0001", ix: 1, v: { a: 0, k: 150, ix: 1 } }, { ty: 7, nm: "Blur Dimensions", mn: "ADBE Gaussian Blur 2-0002", ix: 2, v: { a: 0, k: 1, ix: 2 } }, { ty: 7, nm: "Repeat Edge Pixels", mn: "ADBE Gaussian Blur 2-0003", ix: 3, v: { a: 0, k: 0, ix: 3 } }] }], shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 0, k: { i: [[446.031, 78.565], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], o: [[-474.322, -83.548], [0, 0], [0, 0], [0.57, 0.727], [0, 0], [-8.99, -11.449]], v: [[-95.525, 259.75], [-429.671, -292.588], [-219.085, -449.194], [448.196, 448.091], [449.016, 449.194], [448.196, 448.091]], c: true }, ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "fl", c: { a: 0, k: [0.129411771894, 0.149019613862, 0.313725501299, 1], ix: 4 }, o: { a: 0, k: 100, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Group 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }, { ty: "gr", it: [{ ty: "rc", d: 1, s: { a: 0, k: [1200, 900], ix: 2 }, p: { a: 0, k: [0, 0], ix: 3 }, r: { a: 0, k: 0, ix: 4 }, nm: "Rectangle Path 1", mn: "ADBE Vector Shape - Rect", hd: false }, { ty: "st", c: { a: 0, k: [0.494117647059, 0.298039215686, 0.619607843137, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 0, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156862745, 0.843137254902, 1], ix: 4 }, o: { a: 0, k: 0, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [178.543, 174.429], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Rectangle 1", np: 3, cix: 2, bm: 0, ix: 2, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 1535, st: 25, ct: 1, bm: 0 }, { ddd: 0, ind: 2, ty: 4, nm: "Layer 5", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 1, k: [{ i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 20, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 140, s: [-9] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 260, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 380, s: [9] }, { t: 500, s: [0] }], ix: 10 }, p: { a: 0, k: [1073.85, -30.391, 0], ix: 2, l: 2 }, a: { a: 0, k: [0, 0, 0], ix: 1, l: 2 }, s: { a: 1, k: [{ i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 20, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 140, s: [134.764, 134.764, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 260, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 380, s: [134.764, 134.764, 100] }, { t: 500, s: [100, 100, 100] }], ix: 6, l: 2 } }, ao: 0, ef: [{ ty: 29, nm: "Gaussian Blur", np: 5, mn: "ADBE Gaussian Blur 2", ix: 1, en: 1, ef: [{ ty: 0, nm: "Blurriness", mn: "ADBE Gaussian Blur 2-0001", ix: 1, v: { a: 0, k: 150, ix: 1 } }, { ty: 7, nm: "Blur Dimensions", mn: "ADBE Gaussian Blur 2-0002", ix: 2, v: { a: 0, k: 1, ix: 2 } }, { ty: 7, nm: "Repeat Edge Pixels", mn: "ADBE Gaussian Blur 2-0003", ix: 3, v: { a: 0, k: 0, ix: 3 } }] }], shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 0, k: { i: [[424.081, 79.754], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]], o: [[-450.977, -84.811], [0, 0], [0, 0], [0.55, 0.7], [0, 0], [-8.65, -11.031]], v: [[-50.221, 245.909], [-467.951, -214.723], [-174.945, -432.62], [467.71, 431.558], [468.5, 432.62], [467.71, 431.558]], c: true }, ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156875134, 0.843137264252, 1], ix: 4 }, o: { a: 0, k: 100, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Group 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }, { ty: "gr", it: [{ ty: "rc", d: 1, s: { a: 0, k: [1200, 900], ix: 2 }, p: { a: 0, k: [0, 0], ix: 3 }, r: { a: 0, k: 0, ix: 4 }, nm: "Rectangle Path 1", mn: "ADBE Vector Shape - Rect", hd: false }, { ty: "st", c: { a: 0, k: [0.494117647059, 0.298039215686, 0.619607843137, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 0, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156862745, 0.843137254902, 1], ix: 4 }, o: { a: 0, k: 0, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [178.543, 174.429], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Rectangle 1", np: 3, cix: 2, bm: 0, ix: 2, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 1530, st: 20, ct: 1, bm: 0 }, { ddd: 0, ind: 3, ty: 4, nm: "Layer 4", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 1, k: [{ i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 15, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 135, s: [-9] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 255, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 375, s: [9] }, { t: 495, s: [0] }], ix: 10 }, p: { a: 0, k: [988.859, 75.079, 0], ix: 2, l: 2 }, a: { a: 0, k: [0, 0, 0], ix: 1, l: 2 }, s: { a: 1, k: [{ i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 15, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 135, s: [134.764, 134.764, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 255, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 375, s: [134.764, 134.764, 100] }, { t: 495, s: [100, 100, 100] }], ix: 6, l: 2 } }, ao: 0, ef: [{ ty: 29, nm: "Gaussian Blur", np: 5, mn: "ADBE Gaussian Blur 2", ix: 1, en: 1, ef: [{ ty: 0, nm: "Blurriness", mn: "ADBE Gaussian Blur 2-0001", ix: 1, v: { a: 0, k: 100, ix: 1 } }, { ty: 7, nm: "Blur Dimensions", mn: "ADBE Gaussian Blur 2-0002", ix: 2, v: { a: 0, k: 1, ix: 2 } }, { ty: 7, nm: "Repeat Edge Pixels", mn: "ADBE Gaussian Blur 2-0003", ix: 3, v: { a: 0, k: 0, ix: 3 } }] }], shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 1, k: [{ i: { x: 0.833, y: 1 }, o: { x: 0.333, y: 0 }, t: 75, s: [{ i: [[432.399, 124.912], [0, 0], [0, 0], [123.76, -96.677]], o: [[-432.397, -124.911], [0, 0], [0, 0], [-123.77, 96.676]], v: [[-78.678, 155.686], [-500.894, -232.49], [-167.127, -480.7], [487.581, 460.594]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.167, y: 0 }, t: 195, s: [{ i: [[432.399, 124.912], [0, 0], [0, 0], [123.76, -96.677]], o: [[-432.397, -124.911], [0, 0], [0, 0], [-123.77, 96.676]], v: [[-97.842, 203.742], [-500.894, -232.49], [-167.127, -480.7], [487.581, 460.594]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.167, y: 0 }, t: 315, s: [{ i: [[253.734, 244.526], [0, 0], [0, 0], [123.76, -96.677]], o: [[-324.079, -312.318], [0, 0], [0, 0], [-123.77, 96.676]], v: [[-129.581, 213.076], [-500.894, -232.49], [-167.127, -480.7], [487.581, 460.594]], c: true }] }, { i: { x: 0.667, y: 1 }, o: { x: 0.167, y: 0 }, t: 435, s: [{ i: [[226.573, 11.739], [0, 0], [0, 0], [123.76, -96.677]], o: [[-147.242, -7.629], [0, 0], [0, 0], [-123.77, 96.676]], v: [[-215.336, 122.406], [-500.894, -232.49], [-167.127, -480.7], [487.581, 460.594]], c: true }] }, { t: 529, s: [{ i: [[432.399, 124.912], [0, 0], [0, 0], [123.76, -96.677]], o: [[-432.397, -124.911], [0, 0], [0, 0], [-123.77, 96.676]], v: [[-78.678, 155.686], [-500.894, -232.49], [-167.127, -480.7], [487.581, 460.594]], c: true }] }], ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "fl", c: { a: 0, k: [0.929411768913, 1, 0.482352942228, 1], ix: 4 }, o: { a: 0, k: 100, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Group 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }, { ty: "gr", it: [{ ty: "rc", d: 1, s: { a: 0, k: [1200, 900], ix: 2 }, p: { a: 0, k: [0, 0], ix: 3 }, r: { a: 0, k: 0, ix: 4 }, nm: "Rectangle Path 1", mn: "ADBE Vector Shape - Rect", hd: false }, { ty: "st", c: { a: 0, k: [0.494117647059, 0.298039215686, 0.619607843137, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 0, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156862745, 0.843137254902, 1], ix: 4 }, o: { a: 0, k: 0, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [178.543, 174.429], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Rectangle 1", np: 3, cix: 2, bm: 0, ix: 2, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 1525, st: 15, ct: 1, bm: 0 }, { ddd: 0, ind: 4, ty: 4, nm: "Layer 3", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 1, k: [{ i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 10, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 130, s: [-9] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 250, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 370, s: [9] }, { t: 490, s: [0] }], ix: 10 }, p: { a: 0, k: [894.117, 84.677, 0], ix: 2, l: 2 }, a: { a: 0, k: [0, 0, 0], ix: 1, l: 2 }, s: { a: 1, k: [{ i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 10, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 130, s: [134.764, 134.764, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 250, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 370, s: [134.764, 134.764, 100] }, { t: 490, s: [100, 100, 100] }], ix: 6, l: 2 } }, ao: 0, ef: [{ ty: 29, nm: "Gaussian Blur", np: 5, mn: "ADBE Gaussian Blur 2", ix: 1, en: 1, ef: [{ ty: 0, nm: "Blurriness", mn: "ADBE Gaussian Blur 2-0001", ix: 1, v: { a: 0, k: 40, ix: 1 } }, { ty: 7, nm: "Blur Dimensions", mn: "ADBE Gaussian Blur 2-0002", ix: 2, v: { a: 0, k: 1, ix: 2 } }, { ty: 7, nm: "Repeat Edge Pixels", mn: "ADBE Gaussian Blur 2-0003", ix: 3, v: { a: 0, k: 0, ix: 3 } }] }], shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 1, k: [{ i: { x: 0.667, y: 1 }, o: { x: 0.167, y: 0 }, t: 67, s: [{ i: [[361.666, 65.659], [0, 0], [0, 0], [92.214, -68.58]], o: [[-361.667, -65.659], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-99.227, 158.019], [-431.16, -238.63], [-176.178, -428.251], [423.289, 416.898]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.333, y: 0 }, t: 190, s: [{ i: [[303.862, 85.416], [0, 0], [0, 0], [92.214, -68.58]], o: [[-353.863, -99.472], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-114.955, 184.127], [-431.16, -238.63], [-176.178, -428.251], [423.289, 416.898]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.167, y: 0 }, t: 310, s: [{ i: [[66.949, 140.982], [0, 0], [0, 0], [92.213, -68.58]], o: [[-157.679, -332.04], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-182.308, 153.536], [-647.392, -141.284], [-176.178, -428.251], [423.29, 416.898]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.167, y: 0 }, t: 430, s: [{ i: [[160.75, 51.563], [0, 0], [0, 0], [92.213, -68.58]], o: [[-350.011, -112.272], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-133.05, 149.658], [-420.434, -232.638], [-176.178, -428.251], [423.29, 416.898]], c: true }] }, { t: 524, s: [{ i: [[361.666, 65.659], [0, 0], [0, 0], [92.214, -68.58]], o: [[-361.667, -65.659], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-99.227, 158.019], [-431.16, -238.63], [-176.178, -428.251], [423.289, 416.898]], c: true }] }], ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "st", c: { a: 0, k: [0.129411771894, 0.149019613862, 0.313725501299, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 8, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Group 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }, { ty: "gr", it: [{ ty: "rc", d: 1, s: { a: 0, k: [1200, 900], ix: 2 }, p: { a: 0, k: [0, 0], ix: 3 }, r: { a: 0, k: 0, ix: 4 }, nm: "Rectangle Path 1", mn: "ADBE Vector Shape - Rect", hd: false }, { ty: "st", c: { a: 0, k: [0.494117647059, 0.298039215686, 0.619607843137, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 0, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156862745, 0.843137254902, 1], ix: 4 }, o: { a: 0, k: 0, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [178.543, 174.429], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Rectangle 1", np: 3, cix: 2, bm: 0, ix: 2, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 1520, st: 10, ct: 1, bm: 0 }, { ddd: 0, ind: 5, ty: 4, nm: "Layer 2", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 1, k: [{ i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 5, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 125, s: [-9] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 245, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 365, s: [9] }, { t: 485, s: [0] }], ix: 10 }, p: { a: 0, k: [894.117, 83.978, 0], ix: 2, l: 2 }, a: { a: 0, k: [0, 0, 0], ix: 1, l: 2 }, s: { a: 1, k: [{ i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 5, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 125, s: [134.764, 134.764, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 245, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 365, s: [134.764, 134.764, 100] }, { t: 485, s: [100, 100, 100] }], ix: 6, l: 2 } }, ao: 0, shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 1, k: [{ i: { x: 0.667, y: 1 }, o: { x: 0.167, y: 0 }, t: 62, s: [{ i: [[361.666, 65.659], [0, 0], [0, 0], [92.214, -68.58]], o: [[-361.667, -65.659], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-99.227, 158.019], [-431.16, -238.63], [-176.178, -428.251], [423.289, 416.898]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.333, y: 0 }, t: 185, s: [{ i: [[303.862, 85.416], [0, 0], [0, 0], [92.214, -68.58]], o: [[-353.863, -99.472], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-114.955, 184.127], [-431.16, -238.63], [-176.178, -428.251], [423.289, 416.898]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.167, y: 0 }, t: 305, s: [{ i: [[66.949, 140.982], [0, 0], [0, 0], [92.213, -68.58]], o: [[-157.679, -332.04], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-182.308, 153.536], [-647.392, -141.284], [-176.178, -428.251], [423.29, 416.898]], c: true }] }, { i: { x: 0.833, y: 1 }, o: { x: 0.167, y: 0 }, t: 425, s: [{ i: [[160.75, 51.563], [0, 0], [0, 0], [92.213, -68.58]], o: [[-350.011, -112.272], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-133.05, 149.658], [-420.434, -232.638], [-176.178, -428.251], [423.29, 416.898]], c: true }] }, { t: 519, s: [{ i: [[361.666, 65.659], [0, 0], [0, 0], [92.214, -68.58]], o: [[-361.667, -65.659], [0, 0], [0, 0], [-92.219, 68.579]], v: [[-99.227, 158.019], [-431.16, -238.63], [-176.178, -428.251], [423.289, 416.898]], c: true }] }], ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "fl", c: { a: 0, k: [0.956862747669, 0.980392158031, 0.976470589638, 1], ix: 4 }, o: { a: 0, k: 100, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Group 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }, { ty: "gr", it: [{ ty: "rc", d: 1, s: { a: 0, k: [1200, 900], ix: 2 }, p: { a: 0, k: [0, 0], ix: 3 }, r: { a: 0, k: 0, ix: 4 }, nm: "Rectangle Path 1", mn: "ADBE Vector Shape - Rect", hd: false }, { ty: "st", c: { a: 0, k: [0.494117647059, 0.298039215686, 0.619607843137, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 0, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156862745, 0.843137254902, 1], ix: 4 }, o: { a: 0, k: 0, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [178.543, 174.429], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Rectangle 1", np: 3, cix: 2, bm: 0, ix: 2, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 1515, st: 5, ct: 1, bm: 0 }, { ddd: 0, ind: 6, ty: 4, nm: "Layer 1", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 1, k: [{ i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 0, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 120, s: [-9] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 240, s: [0] }, { i: { x: [0.667], y: [1] }, o: { x: [0.333], y: [0] }, t: 360, s: [9] }, { t: 480, s: [0] }], ix: 10 }, p: { a: 0, k: [895.851, 111.19, 0], ix: 2, l: 2 }, a: { a: 0, k: [0, 0, 0], ix: 1, l: 2 }, s: { a: 1, k: [{ i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 0, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 120, s: [134.764, 134.764, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 240, s: [100, 100, 100] }, { i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] }, o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] }, t: 360, s: [134.764, 134.764, 100] }, { t: 480, s: [100, 100, 100] }], ix: 6, l: 2 } }, ao: 0, ef: [{ ty: 29, nm: "Gaussian Blur", np: 5, mn: "ADBE Gaussian Blur 2", ix: 1, en: 1, ef: [{ ty: 0, nm: "Blurriness", mn: "ADBE Gaussian Blur 2-0001", ix: 1, v: { a: 0, k: 200, ix: 1 } }, { ty: 7, nm: "Blur Dimensions", mn: "ADBE Gaussian Blur 2-0002", ix: 2, v: { a: 0, k: 1, ix: 2 } }, { ty: 7, nm: "Repeat Edge Pixels", mn: "ADBE Gaussian Blur 2-0003", ix: 3, v: { a: 0, k: 0, ix: 3 } }] }], shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 1, k: [{ i: { x: 0.667, y: 1 }, o: { x: 0.333, y: 0 }, t: 57, s: [{ i: [[261.24, 94.803], [0, 0], [0, 0], [280.19, -208.366]], o: [[-261.24, -94.803], [0, 0], [0, 0], [-280.189, 208.367]], v: [[-130.27, 227.181], [-489.015, -224.108], [-180.898, -453.243], [434.739, 374.6]], c: true }] }, { i: { x: 0.667, y: 1 }, o: { x: 0.333, y: 0 }, t: 180, s: [{ i: [[240.029, 117.135], [0, 0], [0, 0], [280.191, -208.366]], o: [[-249.757, -121.882], [0, 0], [0, 0], [-280.189, 208.367]], v: [[-256.037, 109.609], [-489.015, -224.108], [-180.898, -453.243], [434.739, 374.6]], c: true }] }, { i: { x: 0.667, y: 1 }, o: { x: 0.333, y: 0 }, t: 300, s: [{ i: [[153.185, 80.344], [0, 0], [0, 0], [280.191, -208.366]], o: [[-246.114, -129.083], [0, 0], [0, 0], [-280.189, 208.367]], v: [[-99.854, 269.938], [-489.015, -224.108], [-180.898, -453.243], [434.739, 374.6]], c: true }] }, { i: { x: 0.667, y: 1 }, o: { x: 0.333, y: 0 }, t: 420, s: [{ i: [[172.303, 15.256], [0, 0], [0, 0], [280.191, -208.366]], o: [[-418.35, -37.043], [0, 0], [0, 0], [-280.189, 208.367]], v: [[-1.548, 216.055], [-489.015, -224.108], [-180.898, -453.243], [434.739, 374.6]], c: true }] }, { t: 514, s: [{ i: [[261.24, 94.803], [0, 0], [0, 0], [280.19, -208.366]], o: [[-261.24, -94.803], [0, 0], [0, 0], [-280.189, 208.367]], v: [[-130.27, 227.181], [-489.015, -224.108], [-180.898, -453.243], [434.739, 374.6]], c: true }] }], ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156875134, 0.843137264252, 1], ix: 4 }, o: { a: 0, k: 100, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Group 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }, { ty: "gr", it: [{ ty: "rc", d: 1, s: { a: 0, k: [1200, 900], ix: 2 }, p: { a: 0, k: [0, 0], ix: 3 }, r: { a: 0, k: 0, ix: 4 }, nm: "Rectangle Path 1", mn: "ADBE Vector Shape - Rect", hd: false }, { ty: "st", c: { a: 0, k: [0.494117647059, 0.298039215686, 0.619607843137, 1], ix: 3 }, o: { a: 0, k: 100, ix: 4 }, w: { a: 0, k: 0, ix: 5 }, lc: 1, lj: 1, ml: 4, bm: 0, nm: "Stroke 1", mn: "ADBE Vector Graphic - Stroke", hd: false }, { ty: "fl", c: { a: 0, k: [0, 0.792156862745, 0.843137254902, 1], ix: 4 }, o: { a: 0, k: 0, ix: 5 }, r: 1, bm: 0, nm: "Fill 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [0, 0], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [178.543, 174.429], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Rectangle 1", np: 3, cix: 2, bm: 0, ix: 2, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 1510, st: 0, ct: 1, bm: 0 }], markers: [], props: {} };
|
|
4287
5512
|
|
|
4288
5513
|
// src/components/FormField/translations.json
|
|
4289
|
-
var
|
|
5514
|
+
var translations_default2 = {
|
|
4290
5515
|
nl: {
|
|
4291
5516
|
formField: {
|
|
4292
5517
|
selectPlaceholder: "Selecteer een optie",
|
|
@@ -4337,7 +5562,7 @@ var FormField = ({
|
|
|
4337
5562
|
onRightIconClick: onRightIconClick2,
|
|
4338
5563
|
tooltipContent
|
|
4339
5564
|
}) => {
|
|
4340
|
-
const t = getSection(
|
|
5565
|
+
const t = getSection(translations_default2, "formField");
|
|
4341
5566
|
const selectPlaceholderText = selectPlaceholder || t.selectPlaceholder;
|
|
4342
5567
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
4343
5568
|
const tooltipRef = useRef(null);
|
|
@@ -4364,19 +5589,19 @@ var FormField = ({
|
|
|
4364
5589
|
};
|
|
4365
5590
|
const renderControl = () => {
|
|
4366
5591
|
if (type === "select") {
|
|
4367
|
-
return /* @__PURE__ */
|
|
5592
|
+
return /* @__PURE__ */ React9.createElement("select", { ...baseControlProps }, /* @__PURE__ */ React9.createElement("option", { value: "" }, selectPlaceholderText), options.map((opt) => /* @__PURE__ */ React9.createElement("option", { key: opt.value, value: opt.value }, opt.label)));
|
|
4368
5593
|
}
|
|
4369
5594
|
if (type === "textarea")
|
|
4370
|
-
return /* @__PURE__ */
|
|
4371
|
-
return /* @__PURE__ */
|
|
5595
|
+
return /* @__PURE__ */ React9.createElement("textarea", { ...baseControlProps, placeholder });
|
|
5596
|
+
return /* @__PURE__ */ React9.createElement("input", { type, ...baseControlProps, placeholder });
|
|
4372
5597
|
};
|
|
4373
|
-
return /* @__PURE__ */
|
|
5598
|
+
return /* @__PURE__ */ React9.createElement(
|
|
4374
5599
|
"div",
|
|
4375
5600
|
{
|
|
4376
5601
|
className: `form-group ${halfWidth ? "half-width" : ""}`,
|
|
4377
5602
|
style: { position: "relative" }
|
|
4378
5603
|
},
|
|
4379
|
-
/* @__PURE__ */
|
|
5604
|
+
/* @__PURE__ */ React9.createElement("div", { className: "input-container" }, Icon && /* @__PURE__ */ React9.createElement(Icon, { className: "input-icon" }), renderControl(), RightIconComponent && /* @__PURE__ */ React9.createElement(
|
|
4380
5605
|
"div",
|
|
4381
5606
|
{
|
|
4382
5607
|
className: "magic-wand-container",
|
|
@@ -4396,14 +5621,14 @@ var FormField = ({
|
|
|
4396
5621
|
cursor: "pointer"
|
|
4397
5622
|
}
|
|
4398
5623
|
},
|
|
4399
|
-
/* @__PURE__ */
|
|
5624
|
+
/* @__PURE__ */ React9.createElement(
|
|
4400
5625
|
RightIconComponent,
|
|
4401
5626
|
{
|
|
4402
5627
|
className: "magic-wand-icon",
|
|
4403
5628
|
style: { color: "#B567C2" }
|
|
4404
5629
|
}
|
|
4405
5630
|
),
|
|
4406
|
-
showTooltip && tooltipContent && /* @__PURE__ */
|
|
5631
|
+
showTooltip && tooltipContent && /* @__PURE__ */ React9.createElement(
|
|
4407
5632
|
"div",
|
|
4408
5633
|
{
|
|
4409
5634
|
ref: tooltipRef,
|
|
@@ -4423,7 +5648,7 @@ var FormField = ({
|
|
|
4423
5648
|
overflow: "hidden"
|
|
4424
5649
|
}
|
|
4425
5650
|
},
|
|
4426
|
-
/* @__PURE__ */
|
|
5651
|
+
/* @__PURE__ */ React9.createElement(
|
|
4427
5652
|
"div",
|
|
4428
5653
|
{
|
|
4429
5654
|
className: "lottie-container",
|
|
@@ -4438,7 +5663,7 @@ var FormField = ({
|
|
|
4438
5663
|
zIndex: 1
|
|
4439
5664
|
}
|
|
4440
5665
|
},
|
|
4441
|
-
/* @__PURE__ */
|
|
5666
|
+
/* @__PURE__ */ React9.createElement(
|
|
4442
5667
|
Lottie,
|
|
4443
5668
|
{
|
|
4444
5669
|
animationData: magicAnimation_default,
|
|
@@ -4447,7 +5672,7 @@ var FormField = ({
|
|
|
4447
5672
|
}
|
|
4448
5673
|
)
|
|
4449
5674
|
),
|
|
4450
|
-
/* @__PURE__ */
|
|
5675
|
+
/* @__PURE__ */ React9.createElement("div", { style: { position: "relative", zIndex: 2, padding: "12px 20px" } }, /* @__PURE__ */ React9.createElement(
|
|
4451
5676
|
"div",
|
|
4452
5677
|
{
|
|
4453
5678
|
style: {
|
|
@@ -4457,7 +5682,7 @@ var FormField = ({
|
|
|
4457
5682
|
}
|
|
4458
5683
|
},
|
|
4459
5684
|
tooltipContent
|
|
4460
|
-
), /* @__PURE__ */
|
|
5685
|
+
), /* @__PURE__ */ React9.createElement(
|
|
4461
5686
|
"div",
|
|
4462
5687
|
{
|
|
4463
5688
|
style: {
|
|
@@ -4468,7 +5693,7 @@ var FormField = ({
|
|
|
4468
5693
|
}
|
|
4469
5694
|
},
|
|
4470
5695
|
t.tooltip?.confirm
|
|
4471
|
-
), /* @__PURE__ */
|
|
5696
|
+
), /* @__PURE__ */ React9.createElement(
|
|
4472
5697
|
"div",
|
|
4473
5698
|
{
|
|
4474
5699
|
style: {
|
|
@@ -4482,71 +5707,17 @@ var FormField = ({
|
|
|
4482
5707
|
))
|
|
4483
5708
|
)
|
|
4484
5709
|
)),
|
|
4485
|
-
error && /* @__PURE__ */
|
|
5710
|
+
error && /* @__PURE__ */ React9.createElement("p", { className: "form-error" }, error)
|
|
4486
5711
|
);
|
|
4487
5712
|
};
|
|
4488
5713
|
var FormField_default = FormField;
|
|
4489
5714
|
|
|
4490
5715
|
// src/components/ReservationStepTwo/ReservationStepTwo.js
|
|
4491
|
-
var
|
|
5716
|
+
var import_moment3 = __toESM(require_moment());
|
|
4492
5717
|
__toESM(require_nl());
|
|
4493
|
-
var useApi = () => {
|
|
4494
|
-
const getJwtToken = useCallback(() => {
|
|
4495
|
-
return localStorage.getItem("accessToken");
|
|
4496
|
-
}, []);
|
|
4497
|
-
const get = useCallback(
|
|
4498
|
-
(endpoint, config = {}) => {
|
|
4499
|
-
const { params, ...axiosConfig } = config;
|
|
4500
|
-
const token = getJwtToken();
|
|
4501
|
-
return axios.get(endpoint, {
|
|
4502
|
-
...axiosConfig,
|
|
4503
|
-
params,
|
|
4504
|
-
headers: {
|
|
4505
|
-
...axiosConfig.headers,
|
|
4506
|
-
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
4507
|
-
}
|
|
4508
|
-
}).then((response) => response.data).catch((error) => {
|
|
4509
|
-
console.error("Error fetching data:", error);
|
|
4510
|
-
throw error;
|
|
4511
|
-
});
|
|
4512
|
-
},
|
|
4513
|
-
[getJwtToken]
|
|
4514
|
-
);
|
|
4515
|
-
const mutate = useCallback(
|
|
4516
|
-
(method, endpoint, data = null, config = {}) => {
|
|
4517
|
-
const token = getJwtToken();
|
|
4518
|
-
return axios({
|
|
4519
|
-
method,
|
|
4520
|
-
url: endpoint,
|
|
4521
|
-
data,
|
|
4522
|
-
...config,
|
|
4523
|
-
headers: {
|
|
4524
|
-
...config.headers,
|
|
4525
|
-
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
4526
|
-
}
|
|
4527
|
-
}).then((response) => response.data).catch((error) => {
|
|
4528
|
-
console.error(`Error with ${method} request:`, error);
|
|
4529
|
-
throw error;
|
|
4530
|
-
});
|
|
4531
|
-
},
|
|
4532
|
-
[getJwtToken]
|
|
4533
|
-
);
|
|
4534
|
-
const apiMethods = useMemo(
|
|
4535
|
-
() => ({
|
|
4536
|
-
get,
|
|
4537
|
-
post: (endpoint, data, config) => mutate("POST", endpoint, data, config),
|
|
4538
|
-
put: (endpoint, data, config) => mutate("PUT", endpoint, data, config),
|
|
4539
|
-
patch: (endpoint, data, config) => mutate("PATCH", endpoint, data, config),
|
|
4540
|
-
delete: (endpoint, config) => mutate("DELETE", endpoint, null, config)
|
|
4541
|
-
}),
|
|
4542
|
-
[get, mutate]
|
|
4543
|
-
);
|
|
4544
|
-
return apiMethods;
|
|
4545
|
-
};
|
|
4546
|
-
var useApi_default = useApi;
|
|
4547
5718
|
|
|
4548
5719
|
// src/components/ReservationStepTwo/translations.json
|
|
4549
|
-
var
|
|
5720
|
+
var translations_default3 = {
|
|
4550
5721
|
nl: {
|
|
4551
5722
|
reservationStepTwoFiltering: {
|
|
4552
5723
|
labels: {
|
|
@@ -4681,25 +5852,25 @@ var ReservationStepTwo = ({
|
|
|
4681
5852
|
menuData
|
|
4682
5853
|
}) => {
|
|
4683
5854
|
const lang = getPreferredLanguage();
|
|
4684
|
-
const t = getSection(
|
|
5855
|
+
const t = getSection(translations_default3, "reservationStepTwoFiltering");
|
|
4685
5856
|
const [availableMenus, setAvailableMenus] = useState([]);
|
|
4686
5857
|
const [hasAutofilled, setHasAutofilled] = useState(false);
|
|
4687
5858
|
const [pendingAutofill, setPendingAutofill] = useState(null);
|
|
4688
5859
|
const api = useApi_default();
|
|
4689
5860
|
useEffect(() => {
|
|
4690
|
-
|
|
5861
|
+
import_moment3.default.locale(lang);
|
|
4691
5862
|
if (!formData.date || !formData.time || !menuData.length) return setAvailableMenus([]);
|
|
4692
|
-
const sel = (0,
|
|
5863
|
+
const sel = (0, import_moment3.default)(`${formData.date} ${formData.time}`, "YYYY-MM-DD HH:mm");
|
|
4693
5864
|
const filtered = menuData.filter((menu) => {
|
|
4694
5865
|
const inDate = sel.isBetween(
|
|
4695
|
-
(0,
|
|
4696
|
-
(0,
|
|
5866
|
+
(0, import_moment3.default)(menu.startDate, "YYYY-MM-DD"),
|
|
5867
|
+
(0, import_moment3.default)(menu.endDate, "YYYY-MM-DD"),
|
|
4697
5868
|
"day",
|
|
4698
5869
|
"[]"
|
|
4699
5870
|
);
|
|
4700
|
-
const inTime = (0,
|
|
4701
|
-
(0,
|
|
4702
|
-
(0,
|
|
5871
|
+
const inTime = (0, import_moment3.default)(formData.time, "HH:mm").isBetween(
|
|
5872
|
+
(0, import_moment3.default)(menu.startHour, "HH:mm"),
|
|
5873
|
+
(0, import_moment3.default)(menu.endHour, "HH:mm"),
|
|
4703
5874
|
"minute",
|
|
4704
5875
|
"[]"
|
|
4705
5876
|
);
|
|
@@ -4747,15 +5918,15 @@ var ReservationStepTwo = ({
|
|
|
4747
5918
|
return {
|
|
4748
5919
|
email: emailActive ? {
|
|
4749
5920
|
...common,
|
|
4750
|
-
tooltipContent: /* @__PURE__ */
|
|
5921
|
+
tooltipContent: /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("div", { style: { textAlign: "center", fontWeight: "bold" } }, t.magic?.title), /* @__PURE__ */ React9.createElement("div", null, pendingAutofill.firstName, " ", pendingAutofill.lastName), /* @__PURE__ */ React9.createElement("div", null, pendingAutofill.phone))
|
|
4751
5922
|
} : {},
|
|
4752
5923
|
phone: phoneActive ? {
|
|
4753
5924
|
...common,
|
|
4754
|
-
tooltipContent: /* @__PURE__ */
|
|
5925
|
+
tooltipContent: /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement("div", { style: { textAlign: "center", fontWeight: "bold" } }, t.magic?.title), /* @__PURE__ */ React9.createElement("div", null, pendingAutofill.firstName, " ", pendingAutofill.lastName), /* @__PURE__ */ React9.createElement("div", null, pendingAutofill.email))
|
|
4755
5926
|
} : {}
|
|
4756
5927
|
};
|
|
4757
5928
|
}, [pendingAutofill, formData.email, formData.phone, t.magic?.title]);
|
|
4758
|
-
return /* @__PURE__ */
|
|
5929
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "reservation-step-two" }, /* @__PURE__ */ React9.createElement("div", { className: "account-manage-form" }, availableMenus.length > 0 && /* @__PURE__ */ React9.createElement(
|
|
4759
5930
|
FormField_default,
|
|
4760
5931
|
{
|
|
4761
5932
|
label: t.labels?.menu || "Menu",
|
|
@@ -4766,7 +5937,7 @@ var ReservationStepTwo = ({
|
|
|
4766
5937
|
onChange: handleChange,
|
|
4767
5938
|
error: errors.menu
|
|
4768
5939
|
}
|
|
4769
|
-
), /* @__PURE__ */
|
|
5940
|
+
), /* @__PURE__ */ React9.createElement("div", { className: "name-fields" }, /* @__PURE__ */ React9.createElement(
|
|
4770
5941
|
FormField_default,
|
|
4771
5942
|
{
|
|
4772
5943
|
label: t.labels?.firstName || "Voornaam",
|
|
@@ -4777,7 +5948,7 @@ var ReservationStepTwo = ({
|
|
|
4777
5948
|
error: errors.firstName,
|
|
4778
5949
|
icon: FaUser
|
|
4779
5950
|
}
|
|
4780
|
-
), /* @__PURE__ */
|
|
5951
|
+
), /* @__PURE__ */ React9.createElement(
|
|
4781
5952
|
FormField_default,
|
|
4782
5953
|
{
|
|
4783
5954
|
label: t.labels?.lastName || "Achternaam",
|
|
@@ -4788,7 +5959,7 @@ var ReservationStepTwo = ({
|
|
|
4788
5959
|
error: errors.lastName,
|
|
4789
5960
|
icon: FaUser
|
|
4790
5961
|
}
|
|
4791
|
-
)), /* @__PURE__ */
|
|
5962
|
+
)), /* @__PURE__ */ React9.createElement(
|
|
4792
5963
|
FormField_default,
|
|
4793
5964
|
{
|
|
4794
5965
|
label: t.labels?.email || "Email",
|
|
@@ -4802,7 +5973,7 @@ var ReservationStepTwo = ({
|
|
|
4802
5973
|
icon: FaEnvelope,
|
|
4803
5974
|
...magicProps.email
|
|
4804
5975
|
}
|
|
4805
|
-
), /* @__PURE__ */
|
|
5976
|
+
), /* @__PURE__ */ React9.createElement(
|
|
4806
5977
|
FormField_default,
|
|
4807
5978
|
{
|
|
4808
5979
|
label: t.labels?.phone || "Telefoon",
|
|
@@ -4816,7 +5987,7 @@ var ReservationStepTwo = ({
|
|
|
4816
5987
|
icon: FaPhone,
|
|
4817
5988
|
...magicProps.phone
|
|
4818
5989
|
}
|
|
4819
|
-
), /* @__PURE__ */
|
|
5990
|
+
), /* @__PURE__ */ React9.createElement(
|
|
4820
5991
|
FormField_default,
|
|
4821
5992
|
{
|
|
4822
5993
|
label: t.labels?.extraInfo || "Extra info",
|
|
@@ -4833,7 +6004,7 @@ var ReservationStepTwo = ({
|
|
|
4833
6004
|
var ReservationStepTwo_default = ReservationStepTwo;
|
|
4834
6005
|
|
|
4835
6006
|
// src/components/ReservationSummary/translations.json
|
|
4836
|
-
var
|
|
6007
|
+
var translations_default4 = {
|
|
4837
6008
|
nl: {
|
|
4838
6009
|
reservationStepTwoFiltering: {
|
|
4839
6010
|
labels: {
|
|
@@ -4964,13 +6135,13 @@ var ReservationSummary = ({
|
|
|
4964
6135
|
formData,
|
|
4965
6136
|
onNewReservation
|
|
4966
6137
|
}) => {
|
|
4967
|
-
const t = getSection(
|
|
4968
|
-
return /* @__PURE__ */
|
|
6138
|
+
const t = getSection(translations_default4, "reservationSummary");
|
|
6139
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "reservation-summary" }, /* @__PURE__ */ React9.createElement("ul", { className: "reservation-details" }, /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.title)), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.guests, ":"), " ", formData.guests), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.date, ":"), " ", formData.date), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.time, ":"), " ", formData.time), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.firstName, ":"), " ", formData.firstName), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.lastName, ":"), " ", formData.lastName), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.email, ":"), " ", formData.email), /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.phone, ":"), " ", formData.phone), formData.menu && /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.menu, ":"), " ", formData.menu), formData.personeel && /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.staff, ":"), " ", formData.personeel), formData.giftcard && /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.giftcard, ":"), " ", formData.giftcard), formData.extraInfo && /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.extraInfo, ":"), " ", formData.extraInfo), formData.zitplaats && /* @__PURE__ */ React9.createElement("li", null, /* @__PURE__ */ React9.createElement("strong", null, t.seatPlace, ":"), " ", formData.zitplaats)), /* @__PURE__ */ React9.createElement("button", { className: "button-style-3", onClick: onNewReservation }, t.newReservationButton));
|
|
4969
6140
|
};
|
|
4970
6141
|
var ReservationSummary_default = ReservationSummary;
|
|
4971
6142
|
|
|
4972
6143
|
// src/components/GiftcardSelection/translations.json
|
|
4973
|
-
var
|
|
6144
|
+
var translations_default5 = {
|
|
4974
6145
|
nl: {
|
|
4975
6146
|
zitplaatsSelection: {
|
|
4976
6147
|
labels: { seating: "Zitplaats" },
|
|
@@ -5013,7 +6184,7 @@ var GiftcardSelection = ({
|
|
|
5013
6184
|
handleChange,
|
|
5014
6185
|
resetFormDataFields
|
|
5015
6186
|
}) => {
|
|
5016
|
-
const t = getSection(
|
|
6187
|
+
const t = getSection(translations_default5, "giftcardSelection");
|
|
5017
6188
|
const [availableGiftcards, setAvailableGiftcards] = useState([]);
|
|
5018
6189
|
useEffect(() => {
|
|
5019
6190
|
if (!restaurantData) return;
|
|
@@ -5035,7 +6206,7 @@ var GiftcardSelection = ({
|
|
|
5035
6206
|
handleChange({ target: { name: "giftcard", value: e.target.value } });
|
|
5036
6207
|
resetFormDataFields(["date", "time"]);
|
|
5037
6208
|
};
|
|
5038
|
-
return /* @__PURE__ */
|
|
6209
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "giftcard-selection" }, /* @__PURE__ */ React9.createElement(
|
|
5039
6210
|
FormField_default,
|
|
5040
6211
|
{
|
|
5041
6212
|
label: t.labels?.giftcard || "Giftcard",
|
|
@@ -5051,7 +6222,7 @@ var GiftcardSelection = ({
|
|
|
5051
6222
|
var GiftcardSelection_default = GiftcardSelection;
|
|
5052
6223
|
|
|
5053
6224
|
// src/components/ZitplaatsSelection/translations.json
|
|
5054
|
-
var
|
|
6225
|
+
var translations_default6 = {
|
|
5055
6226
|
nl: {
|
|
5056
6227
|
zitplaatsSelection: {
|
|
5057
6228
|
labels: { seating: "Zitplaats" },
|
|
@@ -5095,7 +6266,7 @@ var ZitplaatsSelection = ({
|
|
|
5095
6266
|
resetFormDataFields
|
|
5096
6267
|
}) => {
|
|
5097
6268
|
const [availableZitplaatsen, setAvailableZitplaatsen] = useState([]);
|
|
5098
|
-
const t = getSection(
|
|
6269
|
+
const t = getSection(translations_default6, "zitplaatsSelection");
|
|
5099
6270
|
useEffect(() => {
|
|
5100
6271
|
if (!restaurantData?.floors || !Array.isArray(restaurantData.floors)) return;
|
|
5101
6272
|
const set = /* @__PURE__ */ new Set();
|
|
@@ -5112,7 +6283,7 @@ var ZitplaatsSelection = ({
|
|
|
5112
6283
|
const tableSettings = restaurantData?.["table-settings"] || {};
|
|
5113
6284
|
const isTableAssignmentEnabled = tableSettings.isInstalled === true && tableSettings.assignmentMode === "automatic";
|
|
5114
6285
|
if (!isTableAssignmentEnabled || availableZitplaatsen.length === 0) return null;
|
|
5115
|
-
return /* @__PURE__ */
|
|
6286
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "zitplaats-selection" }, /* @__PURE__ */ React9.createElement("label", { htmlFor: "zitplaats", className: "form-label" }, t.labels?.seating || "Zitplaats"), /* @__PURE__ */ React9.createElement("div", { className: "input-container select-field" }, /* @__PURE__ */ React9.createElement(
|
|
5116
6287
|
"select",
|
|
5117
6288
|
{
|
|
5118
6289
|
id: "zitplaats",
|
|
@@ -5120,8 +6291,8 @@ var ZitplaatsSelection = ({
|
|
|
5120
6291
|
value: formData.zitplaats || "",
|
|
5121
6292
|
onChange: handleZitplaatsChange
|
|
5122
6293
|
},
|
|
5123
|
-
/* @__PURE__ */
|
|
5124
|
-
availableZitplaatsen.map((zitplaats) => /* @__PURE__ */
|
|
6294
|
+
/* @__PURE__ */ React9.createElement("option", { value: "" }, t.options?.noPreference || "Geen voorkeur"),
|
|
6295
|
+
availableZitplaatsen.map((zitplaats) => /* @__PURE__ */ React9.createElement(
|
|
5125
6296
|
"option",
|
|
5126
6297
|
{
|
|
5127
6298
|
key: zitplaats,
|
|
@@ -5251,21 +6422,21 @@ var ReservationSidebar = ({
|
|
|
5251
6422
|
onNewReservation();
|
|
5252
6423
|
}, [onNewReservation, setFormData]);
|
|
5253
6424
|
const seatSelectionEnabled = !!restaurantData?.["general-settings"]?.seatSelectionEnabled;
|
|
5254
|
-
return /* @__PURE__ */
|
|
6425
|
+
return /* @__PURE__ */ React9.createElement("div", { className: `reservation-sidebar-component ${isOpen ? "open" : ""}` }, /* @__PURE__ */ React9.createElement("div", { className: "reservation-sidebar-content" }, /* @__PURE__ */ React9.createElement("h2", { className: "admin-title" }, "Admin Reservatie"), /* @__PURE__ */ React9.createElement(
|
|
5255
6426
|
"button",
|
|
5256
6427
|
{
|
|
5257
6428
|
className: "close-sidebar-button",
|
|
5258
6429
|
onClick: onClose,
|
|
5259
6430
|
"aria-label": "Sluiten"
|
|
5260
6431
|
},
|
|
5261
|
-
/* @__PURE__ */
|
|
5262
|
-
), reservationSubmitted ? /* @__PURE__ */
|
|
6432
|
+
/* @__PURE__ */ React9.createElement(FaTimes, { size: 20, color: "#000" })
|
|
6433
|
+
), reservationSubmitted ? /* @__PURE__ */ React9.createElement(
|
|
5263
6434
|
ReservationSummary_default,
|
|
5264
6435
|
{
|
|
5265
6436
|
formData,
|
|
5266
6437
|
onNewReservation: handleNewReservationClick
|
|
5267
6438
|
}
|
|
5268
|
-
) : /* @__PURE__ */
|
|
6439
|
+
) : /* @__PURE__ */ React9.createElement(React9.Fragment, null, restaurantData && Object.keys(restaurantData).length > 0 && /* @__PURE__ */ React9.createElement("div", { className: "sidebar-section-giftcard" }, /* @__PURE__ */ React9.createElement(
|
|
5269
6440
|
GiftcardSelection_default,
|
|
5270
6441
|
{
|
|
5271
6442
|
restaurantData,
|
|
@@ -5273,7 +6444,7 @@ var ReservationSidebar = ({
|
|
|
5273
6444
|
handleChange,
|
|
5274
6445
|
resetFormDataFields
|
|
5275
6446
|
}
|
|
5276
|
-
)), restaurantData && Object.keys(restaurantData).length > 0 && seatSelectionEnabled && /* @__PURE__ */
|
|
6447
|
+
)), restaurantData && Object.keys(restaurantData).length > 0 && seatSelectionEnabled && /* @__PURE__ */ React9.createElement("div", { className: "sidebar-section-zitplaats" }, /* @__PURE__ */ React9.createElement(
|
|
5277
6448
|
ZitplaatsSelection_default,
|
|
5278
6449
|
{
|
|
5279
6450
|
restaurantData,
|
|
@@ -5281,7 +6452,7 @@ var ReservationSidebar = ({
|
|
|
5281
6452
|
handleChange,
|
|
5282
6453
|
resetFormDataFields
|
|
5283
6454
|
}
|
|
5284
|
-
)), availablePersoneel.length > 0 && /* @__PURE__ */
|
|
6455
|
+
)), availablePersoneel.length > 0 && /* @__PURE__ */ React9.createElement("div", { className: "sidebar-section-personeel" }, /* @__PURE__ */ React9.createElement(
|
|
5285
6456
|
FormField_default,
|
|
5286
6457
|
{
|
|
5287
6458
|
label: "",
|
|
@@ -5296,7 +6467,7 @@ var ReservationSidebar = ({
|
|
|
5296
6467
|
error: errors.personeel,
|
|
5297
6468
|
selectPlaceholder: "Toewijzen aan persoon"
|
|
5298
6469
|
}
|
|
5299
|
-
)), /* @__PURE__ */
|
|
6470
|
+
)), /* @__PURE__ */ React9.createElement("div", { className: "sidebar-section-one" }, /* @__PURE__ */ React9.createElement(
|
|
5300
6471
|
ReservationStepOne_default,
|
|
5301
6472
|
{
|
|
5302
6473
|
formData,
|
|
@@ -5308,7 +6479,7 @@ var ReservationSidebar = ({
|
|
|
5308
6479
|
timeblocksError,
|
|
5309
6480
|
restaurantData
|
|
5310
6481
|
}
|
|
5311
|
-
)), /* @__PURE__ */
|
|
6482
|
+
)), /* @__PURE__ */ React9.createElement("div", { className: "sidebar-section-two" }, /* @__PURE__ */ React9.createElement(
|
|
5312
6483
|
ReservationStepTwo_default,
|
|
5313
6484
|
{
|
|
5314
6485
|
formData,
|
|
@@ -5318,7 +6489,7 @@ var ReservationSidebar = ({
|
|
|
5318
6489
|
isSubmitting,
|
|
5319
6490
|
menuData
|
|
5320
6491
|
}
|
|
5321
|
-
)), /* @__PURE__ */
|
|
6492
|
+
)), /* @__PURE__ */ React9.createElement("div", { className: "reservation-footer" }, /* @__PURE__ */ React9.createElement(
|
|
5322
6493
|
"button",
|
|
5323
6494
|
{
|
|
5324
6495
|
type: "button",
|