@planetaexo/design-system 0.3.15 → 0.3.16

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.cjs CHANGED
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var React19 = require('react');
3
+ var React21 = require('react');
4
4
  var classVarianceAuthority = require('class-variance-authority');
5
5
  var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
- var dateFns = require('date-fns');
9
8
  var lucideReact = require('lucide-react');
10
9
  var separator = require('@base-ui/react/separator');
11
10
  var dialog = require('@base-ui/react/dialog');
12
11
  var button = require('@base-ui/react/button');
12
+ var dateFns = require('date-fns');
13
13
  var reactDayPicker = require('react-day-picker');
14
14
  var popover = require('@base-ui/react/popover');
15
15
  var checkbox = require('@base-ui/react/checkbox');
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
36
36
  return Object.freeze(n);
37
37
  }
38
38
 
39
- var React19__namespace = /*#__PURE__*/_interopNamespace(React19);
39
+ var React21__namespace = /*#__PURE__*/_interopNamespace(React21);
40
40
 
41
41
  var __defProp = Object.defineProperty;
42
42
  var __defProps = Object.defineProperties;
@@ -101,7 +101,7 @@ var buttonVariants = classVarianceAuthority.cva(
101
101
  }
102
102
  }
103
103
  );
104
- var Button = React19__namespace.forwardRef(
104
+ var Button = React21__namespace.forwardRef(
105
105
  (_a, ref) => {
106
106
  var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
107
107
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -296,201 +296,10 @@ function DialogDescription(_a) {
296
296
  }, props)
297
297
  );
298
298
  }
299
- function Calendar(_a) {
300
- var _b = _a, {
301
- className,
302
- classNames,
303
- showOutsideDays = true,
304
- captionLayout = "label",
305
- buttonVariant = "ghost",
306
- locale,
307
- formatters,
308
- components
309
- } = _b, props = __objRest(_b, [
310
- "className",
311
- "classNames",
312
- "showOutsideDays",
313
- "captionLayout",
314
- "buttonVariant",
315
- "locale",
316
- "formatters",
317
- "components"
318
- ]);
319
- const defaultClassNames = reactDayPicker.getDefaultClassNames();
320
- return /* @__PURE__ */ jsxRuntime.jsx(
321
- reactDayPicker.DayPicker,
322
- __spreadValues({
323
- showOutsideDays,
324
- className: cn(
325
- "group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
326
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
327
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
328
- className
329
- ),
330
- captionLayout,
331
- locale,
332
- formatters: __spreadValues({
333
- formatMonthDropdown: (date) => date.toLocaleString(locale == null ? void 0 : locale.code, { month: "short" })
334
- }, formatters),
335
- classNames: __spreadValues({
336
- root: cn("w-fit", defaultClassNames.root),
337
- months: cn(
338
- "relative flex flex-col gap-4 md:flex-row",
339
- defaultClassNames.months
340
- ),
341
- month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
342
- nav: cn(
343
- "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
344
- defaultClassNames.nav
345
- ),
346
- button_previous: cn(
347
- buttonVariants2({ variant: buttonVariant }),
348
- "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
349
- defaultClassNames.button_previous
350
- ),
351
- button_next: cn(
352
- buttonVariants2({ variant: buttonVariant }),
353
- "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
354
- defaultClassNames.button_next
355
- ),
356
- month_caption: cn(
357
- "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
358
- defaultClassNames.month_caption
359
- ),
360
- dropdowns: cn(
361
- "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
362
- defaultClassNames.dropdowns
363
- ),
364
- dropdown_root: cn(
365
- "relative rounded-(--cell-radius)",
366
- defaultClassNames.dropdown_root
367
- ),
368
- dropdown: cn(
369
- "absolute inset-0 bg-popover opacity-0",
370
- defaultClassNames.dropdown
371
- ),
372
- caption_label: cn(
373
- "font-medium select-none",
374
- captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
375
- defaultClassNames.caption_label
376
- ),
377
- table: "w-full border-collapse",
378
- weekdays: cn("flex", defaultClassNames.weekdays),
379
- weekday: cn(
380
- "flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
381
- defaultClassNames.weekday
382
- ),
383
- week: cn("mt-2 flex w-full", defaultClassNames.week),
384
- week_number_header: cn(
385
- "w-(--cell-size) select-none",
386
- defaultClassNames.week_number_header
387
- ),
388
- week_number: cn(
389
- "text-[0.8rem] text-muted-foreground select-none",
390
- defaultClassNames.week_number
391
- ),
392
- day: cn(
393
- "group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
394
- props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
395
- defaultClassNames.day
396
- ),
397
- range_start: cn(
398
- "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
399
- defaultClassNames.range_start
400
- ),
401
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
402
- range_end: cn(
403
- "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
404
- defaultClassNames.range_end
405
- ),
406
- today: cn(
407
- "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
408
- defaultClassNames.today
409
- ),
410
- outside: cn(
411
- "text-muted-foreground aria-selected:text-muted-foreground",
412
- defaultClassNames.outside
413
- ),
414
- disabled: cn(
415
- "text-muted-foreground opacity-50",
416
- defaultClassNames.disabled
417
- ),
418
- hidden: cn("invisible", defaultClassNames.hidden)
419
- }, classNames),
420
- components: __spreadValues({
421
- Root: (_a2) => {
422
- var _b2 = _a2, { className: className2, rootRef } = _b2, props2 = __objRest(_b2, ["className", "rootRef"]);
423
- return /* @__PURE__ */ jsxRuntime.jsx(
424
- "div",
425
- __spreadValues({
426
- "data-slot": "calendar",
427
- ref: rootRef,
428
- className: cn(className2)
429
- }, props2)
430
- );
431
- },
432
- Chevron: (_c) => {
433
- var _d = _c, { className: className2, orientation } = _d, props2 = __objRest(_d, ["className", "orientation"]);
434
- if (orientation === "left") {
435
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, __spreadValues({ className: cn("size-4", className2) }, props2));
436
- }
437
- if (orientation === "right") {
438
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, __spreadValues({ className: cn("size-4", className2) }, props2));
439
- }
440
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, __spreadValues({ className: cn("size-4", className2) }, props2));
441
- },
442
- DayButton: (_e) => {
443
- var props2 = __objRest(_e, []);
444
- return /* @__PURE__ */ jsxRuntime.jsx(CalendarDayButton, __spreadValues({ locale }, props2));
445
- },
446
- WeekNumber: (_f) => {
447
- var _g = _f, { children } = _g, props2 = __objRest(_g, ["children"]);
448
- return /* @__PURE__ */ jsxRuntime.jsx("td", __spreadProps(__spreadValues({}, props2), { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }));
449
- }
450
- }, components)
451
- }, props)
452
- );
453
- }
454
- function CalendarDayButton(_a) {
455
- var _b = _a, {
456
- className,
457
- day,
458
- modifiers,
459
- locale
460
- } = _b, props = __objRest(_b, [
461
- "className",
462
- "day",
463
- "modifiers",
464
- "locale"
465
- ]);
466
- const defaultClassNames = reactDayPicker.getDefaultClassNames();
467
- const ref = React19__namespace.useRef(null);
468
- React19__namespace.useEffect(() => {
469
- var _a2;
470
- if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
471
- }, [modifiers.focused]);
472
- return /* @__PURE__ */ jsxRuntime.jsx(
473
- Button2,
474
- __spreadValues({
475
- variant: "ghost",
476
- size: "icon",
477
- "data-day": day.date.toLocaleDateString(locale == null ? void 0 : locale.code),
478
- "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
479
- "data-range-start": modifiers.range_start,
480
- "data-range-end": modifiers.range_end,
481
- "data-range-middle": modifiers.range_middle,
482
- className: cn(
483
- "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
484
- defaultClassNames.day,
485
- className
486
- )
487
- }, props)
488
- );
489
- }
490
- var FloatingInput = React19__namespace.forwardRef(
299
+ var FloatingInput = React21__namespace.forwardRef(
491
300
  (_a, ref) => {
492
301
  var _b = _a, { label, error, id, className, required } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required"]);
493
- const inputId = id != null ? id : React19__namespace.useId();
302
+ const inputId = id != null ? id : React21__namespace.useId();
494
303
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
495
304
  /* @__PURE__ */ jsxRuntime.jsx(
496
305
  "input",
@@ -530,10 +339,10 @@ var FloatingInput = React19__namespace.forwardRef(
530
339
  }
531
340
  );
532
341
  FloatingInput.displayName = "FloatingInput";
533
- var FloatingSelect = React19__namespace.forwardRef(
342
+ var FloatingSelect = React21__namespace.forwardRef(
534
343
  (_a, ref) => {
535
344
  var _b = _a, { label, error, id, className, required, children } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required", "children"]);
536
- const inputId = id != null ? id : React19__namespace.useId();
345
+ const inputId = id != null ? id : React21__namespace.useId();
537
346
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
538
347
  /* @__PURE__ */ jsxRuntime.jsx(
539
348
  "select",
@@ -794,11 +603,11 @@ function PhoneCountrySelect({
794
603
  className
795
604
  }) {
796
605
  var _a;
797
- const [open, setOpen] = React19__namespace.useState(false);
798
- const containerRef = React19__namespace.useRef(null);
799
- const listRef = React19__namespace.useRef(null);
606
+ const [open, setOpen] = React21__namespace.useState(false);
607
+ const containerRef = React21__namespace.useRef(null);
608
+ const listRef = React21__namespace.useRef(null);
800
609
  const selected = (_a = PHONE_COUNTRIES.find((c) => c.code === value)) != null ? _a : PHONE_COUNTRIES[0];
801
- React19__namespace.useEffect(() => {
610
+ React21__namespace.useEffect(() => {
802
611
  if (!open) return;
803
612
  const handler = (e) => {
804
613
  var _a2;
@@ -809,7 +618,7 @@ function PhoneCountrySelect({
809
618
  document.addEventListener("mousedown", handler);
810
619
  return () => document.removeEventListener("mousedown", handler);
811
620
  }, [open]);
812
- React19__namespace.useEffect(() => {
621
+ React21__namespace.useEffect(() => {
813
622
  if (!open || !listRef.current) return;
814
623
  const activeEl = listRef.current.querySelector("[data-selected=true]");
815
624
  activeEl == null ? void 0 : activeEl.scrollIntoView({ block: "nearest" });
@@ -905,145 +714,442 @@ function PhoneCountrySelect({
905
714
  )
906
715
  ] });
907
716
  }
908
- var COUNTRIES = [
909
- { code: "AF", name: "Afghanistan" },
910
- { code: "AL", name: "Albania" },
911
- { code: "DZ", name: "Algeria" },
912
- { code: "AO", name: "Angola" },
913
- { code: "AR", name: "Argentina" },
914
- { code: "AM", name: "Armenia" },
915
- { code: "AU", name: "Australia" },
916
- { code: "AT", name: "Austria" },
917
- { code: "AZ", name: "Azerbaijan" },
918
- { code: "BE", name: "Belgium" },
919
- { code: "BO", name: "Bolivia" },
920
- { code: "BA", name: "Bosnia" },
921
- { code: "BR", name: "Brazil" },
922
- { code: "BG", name: "Bulgaria" },
923
- { code: "KH", name: "Cambodia" },
924
- { code: "CA", name: "Canada" },
925
- { code: "CL", name: "Chile" },
926
- { code: "CN", name: "China" },
927
- { code: "CO", name: "Colombia" },
928
- { code: "CR", name: "Costa Rica" },
929
- { code: "HR", name: "Croatia" },
930
- { code: "CU", name: "Cuba" },
931
- { code: "CZ", name: "Czech Republic" },
932
- { code: "DK", name: "Denmark" },
933
- { code: "DO", name: "Dominican Republic" },
934
- { code: "EC", name: "Ecuador" },
935
- { code: "EG", name: "Egypt" },
936
- { code: "SV", name: "El Salvador" },
937
- { code: "ET", name: "Ethiopia" },
938
- { code: "FI", name: "Finland" },
939
- { code: "FR", name: "France" },
940
- { code: "GE", name: "Georgia" },
941
- { code: "DE", name: "Germany" },
942
- { code: "GH", name: "Ghana" },
943
- { code: "GR", name: "Greece" },
944
- { code: "GT", name: "Guatemala" },
945
- { code: "HN", name: "Honduras" },
946
- { code: "HK", name: "Hong Kong" },
947
- { code: "HU", name: "Hungary" },
948
- { code: "IS", name: "Iceland" },
949
- { code: "IN", name: "India" },
950
- { code: "ID", name: "Indonesia" },
951
- { code: "IR", name: "Iran" },
952
- { code: "IQ", name: "Iraq" },
953
- { code: "IE", name: "Ireland" },
954
- { code: "IL", name: "Israel" },
955
- { code: "IT", name: "Italy" },
956
- { code: "JM", name: "Jamaica" },
957
- { code: "JP", name: "Japan" },
958
- { code: "JO", name: "Jordan" },
959
- { code: "KZ", name: "Kazakhstan" },
960
- { code: "KE", name: "Kenya" },
961
- { code: "KW", name: "Kuwait" },
962
- { code: "LB", name: "Lebanon" },
963
- { code: "LY", name: "Libya" },
964
- { code: "MY", name: "Malaysia" },
965
- { code: "MX", name: "Mexico" },
966
- { code: "MA", name: "Morocco" },
967
- { code: "MZ", name: "Mozambique" },
968
- { code: "NP", name: "Nepal" },
969
- { code: "NL", name: "Netherlands" },
970
- { code: "NZ", name: "New Zealand" },
971
- { code: "NI", name: "Nicaragua" },
972
- { code: "NG", name: "Nigeria" },
973
- { code: "NO", name: "Norway" },
974
- { code: "PK", name: "Pakistan" },
975
- { code: "PA", name: "Panama" },
976
- { code: "PY", name: "Paraguay" },
977
- { code: "PE", name: "Peru" },
978
- { code: "PH", name: "Philippines" },
979
- { code: "PL", name: "Poland" },
980
- { code: "PT", name: "Portugal" },
981
- { code: "QA", name: "Qatar" },
982
- { code: "RO", name: "Romania" },
983
- { code: "RU", name: "Russia" },
984
- { code: "SA", name: "Saudi Arabia" },
985
- { code: "SN", name: "Senegal" },
986
- { code: "RS", name: "Serbia" },
987
- { code: "SG", name: "Singapore" },
988
- { code: "ZA", name: "South Africa" },
989
- { code: "KR", name: "South Korea" },
990
- { code: "ES", name: "Spain" },
991
- { code: "LK", name: "Sri Lanka" },
992
- { code: "SE", name: "Sweden" },
993
- { code: "CH", name: "Switzerland" },
994
- { code: "TW", name: "Taiwan" },
995
- { code: "TZ", name: "Tanzania" },
996
- { code: "TH", name: "Thailand" },
997
- { code: "TN", name: "Tunisia" },
998
- { code: "TR", name: "Turkey" },
999
- { code: "UA", name: "Ukraine" },
1000
- { code: "AE", name: "United Arab Emirates" },
1001
- { code: "GB", name: "United Kingdom" },
1002
- { code: "US", name: "United States" },
1003
- { code: "UY", name: "Uruguay" },
1004
- { code: "UZ", name: "Uzbekistan" },
1005
- { code: "VE", name: "Venezuela" },
1006
- { code: "VN", name: "Vietnam" },
1007
- { code: "YE", name: "Yemen" },
1008
- { code: "ZW", name: "Zimbabwe" }
1009
- ];
1010
- function CountrySearchField({
717
+ function Calendar(_a) {
718
+ var _b = _a, {
719
+ className,
720
+ classNames,
721
+ showOutsideDays = true,
722
+ captionLayout = "label",
723
+ buttonVariant = "ghost",
724
+ locale,
725
+ formatters,
726
+ components
727
+ } = _b, props = __objRest(_b, [
728
+ "className",
729
+ "classNames",
730
+ "showOutsideDays",
731
+ "captionLayout",
732
+ "buttonVariant",
733
+ "locale",
734
+ "formatters",
735
+ "components"
736
+ ]);
737
+ const defaultClassNames = reactDayPicker.getDefaultClassNames();
738
+ return /* @__PURE__ */ jsxRuntime.jsx(
739
+ reactDayPicker.DayPicker,
740
+ __spreadValues({
741
+ showOutsideDays,
742
+ className: cn(
743
+ "group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
744
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
745
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
746
+ className
747
+ ),
748
+ captionLayout,
749
+ locale,
750
+ formatters: __spreadValues({
751
+ formatMonthDropdown: (date) => date.toLocaleString(locale == null ? void 0 : locale.code, { month: "short" })
752
+ }, formatters),
753
+ classNames: __spreadValues({
754
+ root: cn("w-fit", defaultClassNames.root),
755
+ months: cn(
756
+ "relative flex flex-col gap-4 md:flex-row",
757
+ defaultClassNames.months
758
+ ),
759
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
760
+ nav: cn(
761
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
762
+ defaultClassNames.nav
763
+ ),
764
+ button_previous: cn(
765
+ buttonVariants2({ variant: buttonVariant }),
766
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
767
+ defaultClassNames.button_previous
768
+ ),
769
+ button_next: cn(
770
+ buttonVariants2({ variant: buttonVariant }),
771
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
772
+ defaultClassNames.button_next
773
+ ),
774
+ month_caption: cn(
775
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
776
+ defaultClassNames.month_caption
777
+ ),
778
+ dropdowns: cn(
779
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
780
+ defaultClassNames.dropdowns
781
+ ),
782
+ dropdown_root: cn(
783
+ "relative rounded-(--cell-radius)",
784
+ defaultClassNames.dropdown_root
785
+ ),
786
+ dropdown: cn(
787
+ "absolute inset-0 bg-popover opacity-0",
788
+ defaultClassNames.dropdown
789
+ ),
790
+ caption_label: cn(
791
+ "font-medium select-none",
792
+ captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
793
+ defaultClassNames.caption_label
794
+ ),
795
+ table: "w-full border-collapse",
796
+ weekdays: cn("flex", defaultClassNames.weekdays),
797
+ weekday: cn(
798
+ "flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
799
+ defaultClassNames.weekday
800
+ ),
801
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
802
+ week_number_header: cn(
803
+ "w-(--cell-size) select-none",
804
+ defaultClassNames.week_number_header
805
+ ),
806
+ week_number: cn(
807
+ "text-[0.8rem] text-muted-foreground select-none",
808
+ defaultClassNames.week_number
809
+ ),
810
+ day: cn(
811
+ "group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
812
+ props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
813
+ defaultClassNames.day
814
+ ),
815
+ range_start: cn(
816
+ "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
817
+ defaultClassNames.range_start
818
+ ),
819
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
820
+ range_end: cn(
821
+ "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
822
+ defaultClassNames.range_end
823
+ ),
824
+ today: cn(
825
+ "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
826
+ defaultClassNames.today
827
+ ),
828
+ outside: cn(
829
+ "text-muted-foreground aria-selected:text-muted-foreground",
830
+ defaultClassNames.outside
831
+ ),
832
+ disabled: cn(
833
+ "text-muted-foreground opacity-50",
834
+ defaultClassNames.disabled
835
+ ),
836
+ hidden: cn("invisible", defaultClassNames.hidden)
837
+ }, classNames),
838
+ components: __spreadValues({
839
+ Root: (_a2) => {
840
+ var _b2 = _a2, { className: className2, rootRef } = _b2, props2 = __objRest(_b2, ["className", "rootRef"]);
841
+ return /* @__PURE__ */ jsxRuntime.jsx(
842
+ "div",
843
+ __spreadValues({
844
+ "data-slot": "calendar",
845
+ ref: rootRef,
846
+ className: cn(className2)
847
+ }, props2)
848
+ );
849
+ },
850
+ Chevron: (_c) => {
851
+ var _d = _c, { className: className2, orientation } = _d, props2 = __objRest(_d, ["className", "orientation"]);
852
+ if (orientation === "left") {
853
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, __spreadValues({ className: cn("size-4", className2) }, props2));
854
+ }
855
+ if (orientation === "right") {
856
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, __spreadValues({ className: cn("size-4", className2) }, props2));
857
+ }
858
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, __spreadValues({ className: cn("size-4", className2) }, props2));
859
+ },
860
+ DayButton: (_e) => {
861
+ var props2 = __objRest(_e, []);
862
+ return /* @__PURE__ */ jsxRuntime.jsx(CalendarDayButton, __spreadValues({ locale }, props2));
863
+ },
864
+ WeekNumber: (_f) => {
865
+ var _g = _f, { children } = _g, props2 = __objRest(_g, ["children"]);
866
+ return /* @__PURE__ */ jsxRuntime.jsx("td", __spreadProps(__spreadValues({}, props2), { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) }));
867
+ }
868
+ }, components)
869
+ }, props)
870
+ );
871
+ }
872
+ function CalendarDayButton(_a) {
873
+ var _b = _a, {
874
+ className,
875
+ day,
876
+ modifiers,
877
+ locale
878
+ } = _b, props = __objRest(_b, [
879
+ "className",
880
+ "day",
881
+ "modifiers",
882
+ "locale"
883
+ ]);
884
+ const defaultClassNames = reactDayPicker.getDefaultClassNames();
885
+ const ref = React21__namespace.useRef(null);
886
+ React21__namespace.useEffect(() => {
887
+ var _a2;
888
+ if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
889
+ }, [modifiers.focused]);
890
+ return /* @__PURE__ */ jsxRuntime.jsx(
891
+ Button2,
892
+ __spreadValues({
893
+ variant: "ghost",
894
+ size: "icon",
895
+ "data-day": day.date.toLocaleDateString(locale == null ? void 0 : locale.code),
896
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
897
+ "data-range-start": modifiers.range_start,
898
+ "data-range-end": modifiers.range_end,
899
+ "data-range-middle": modifiers.range_middle,
900
+ className: cn(
901
+ "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
902
+ defaultClassNames.day,
903
+ className
904
+ )
905
+ }, props)
906
+ );
907
+ }
908
+ function BirthDateField({
909
+ label,
910
+ required,
1011
911
  value,
1012
912
  onChange,
1013
- required,
1014
- label = "Country",
1015
- countries,
1016
- placeholder = "Search country\u2026",
1017
913
  className
1018
914
  }) {
1019
- var _a;
1020
- const list = countries != null ? countries : COUNTRIES;
1021
- const [query, setQuery] = React19__namespace.useState("");
1022
- const [open, setOpen] = React19__namespace.useState(false);
1023
- const containerRef = React19__namespace.useRef(null);
1024
- const searchRef = React19__namespace.useRef(null);
1025
- const selected = list.find((c) => c.code === value);
1026
- const isFloated = open || !!selected;
1027
- const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
1028
- React19__namespace.useEffect(() => {
915
+ const [open, setOpen] = React21__namespace.useState(false);
916
+ const [text, setText] = React21__namespace.useState(
917
+ value ? dateFns.format(value, "dd/MM/yyyy") : ""
918
+ );
919
+ const containerRef = React21__namespace.useRef(null);
920
+ const inputId = React21__namespace.useId();
921
+ React21__namespace.useEffect(() => {
922
+ setText(value ? dateFns.format(value, "dd/MM/yyyy") : "");
923
+ }, [value]);
924
+ React21__namespace.useEffect(() => {
1029
925
  if (!open) return;
1030
926
  const handler = (e) => {
1031
- var _a2;
1032
- if (!((_a2 = containerRef.current) == null ? void 0 : _a2.contains(e.target))) {
1033
- setOpen(false);
1034
- setQuery("");
1035
- }
927
+ var _a;
928
+ if (!((_a = containerRef.current) == null ? void 0 : _a.contains(e.target))) setOpen(false);
1036
929
  };
1037
930
  document.addEventListener("mousedown", handler);
1038
931
  return () => document.removeEventListener("mousedown", handler);
1039
932
  }, [open]);
1040
- const handleOpen = () => {
1041
- setOpen(true);
1042
- setQuery("");
1043
- setTimeout(() => {
1044
- var _a2;
1045
- return (_a2 = searchRef.current) == null ? void 0 : _a2.focus();
1046
- }, 0);
933
+ const handleTextChange = (e) => {
934
+ const digits = e.target.value.replace(/\D/g, "").slice(0, 8);
935
+ let formatted = digits.slice(0, 2);
936
+ if (digits.length > 2) formatted += "/" + digits.slice(2, 4);
937
+ if (digits.length > 4) formatted += "/" + digits.slice(4, 8);
938
+ setText(formatted);
939
+ if (formatted.length === 10) {
940
+ const [dd, mm, yyyy] = formatted.split("/").map(Number);
941
+ const d = new Date(yyyy, mm - 1, dd);
942
+ if (!isNaN(d.getTime()) && d.getFullYear() === yyyy && d <= /* @__PURE__ */ new Date()) {
943
+ onChange(d);
944
+ return;
945
+ }
946
+ }
947
+ onChange(void 0);
948
+ };
949
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: cn("relative w-full", className), children: [
950
+ /* @__PURE__ */ jsxRuntime.jsxs(
951
+ "div",
952
+ {
953
+ className: cn(
954
+ "flex items-center rounded-lg border border-border bg-background h-14 transition-colors",
955
+ open ? "border-primary ring-1 ring-primary" : "focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"
956
+ ),
957
+ children: [
958
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 h-full", children: [
959
+ /* @__PURE__ */ jsxRuntime.jsxs(
960
+ "label",
961
+ {
962
+ htmlFor: inputId,
963
+ className: "pointer-events-none absolute left-3 top-2 text-xs text-muted-foreground font-ui",
964
+ children: [
965
+ label,
966
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
967
+ ]
968
+ }
969
+ ),
970
+ /* @__PURE__ */ jsxRuntime.jsx(
971
+ "input",
972
+ {
973
+ id: inputId,
974
+ type: "text",
975
+ inputMode: "numeric",
976
+ value: text,
977
+ onChange: handleTextChange,
978
+ placeholder: "dd/mm/yyyy",
979
+ className: "block h-full w-full bg-transparent px-3 pt-5 pb-2 text-base text-foreground font-ui focus:outline-none placeholder:text-muted-foreground/50"
980
+ }
981
+ )
982
+ ] }),
983
+ /* @__PURE__ */ jsxRuntime.jsx(
984
+ "button",
985
+ {
986
+ type: "button",
987
+ onClick: () => setOpen((v) => !v),
988
+ tabIndex: -1,
989
+ "aria-label": "Open calendar",
990
+ className: "px-3 h-full flex items-center text-muted-foreground hover:text-primary transition-colors focus:outline-none",
991
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "h-4 w-4" })
992
+ }
993
+ )
994
+ ]
995
+ }
996
+ ),
997
+ open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-[calc(100%+4px)] left-0 right-0 z-50 rounded-xl border border-border bg-background shadow-lg overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
998
+ Calendar,
999
+ {
1000
+ mode: "single",
1001
+ selected: value,
1002
+ onSelect: (date) => {
1003
+ onChange(date);
1004
+ setOpen(false);
1005
+ },
1006
+ defaultMonth: value != null ? value : new Date(1990, 0, 1),
1007
+ disabled: { after: /* @__PURE__ */ new Date() },
1008
+ className: "font-ui w-full",
1009
+ autoFocus: true
1010
+ }
1011
+ ) })
1012
+ ] });
1013
+ }
1014
+ var COUNTRIES = [
1015
+ { code: "AF", name: "Afghanistan" },
1016
+ { code: "AL", name: "Albania" },
1017
+ { code: "DZ", name: "Algeria" },
1018
+ { code: "AO", name: "Angola" },
1019
+ { code: "AR", name: "Argentina" },
1020
+ { code: "AM", name: "Armenia" },
1021
+ { code: "AU", name: "Australia" },
1022
+ { code: "AT", name: "Austria" },
1023
+ { code: "AZ", name: "Azerbaijan" },
1024
+ { code: "BE", name: "Belgium" },
1025
+ { code: "BO", name: "Bolivia" },
1026
+ { code: "BA", name: "Bosnia" },
1027
+ { code: "BR", name: "Brazil" },
1028
+ { code: "BG", name: "Bulgaria" },
1029
+ { code: "KH", name: "Cambodia" },
1030
+ { code: "CA", name: "Canada" },
1031
+ { code: "CL", name: "Chile" },
1032
+ { code: "CN", name: "China" },
1033
+ { code: "CO", name: "Colombia" },
1034
+ { code: "CR", name: "Costa Rica" },
1035
+ { code: "HR", name: "Croatia" },
1036
+ { code: "CU", name: "Cuba" },
1037
+ { code: "CZ", name: "Czech Republic" },
1038
+ { code: "DK", name: "Denmark" },
1039
+ { code: "DO", name: "Dominican Republic" },
1040
+ { code: "EC", name: "Ecuador" },
1041
+ { code: "EG", name: "Egypt" },
1042
+ { code: "SV", name: "El Salvador" },
1043
+ { code: "ET", name: "Ethiopia" },
1044
+ { code: "FI", name: "Finland" },
1045
+ { code: "FR", name: "France" },
1046
+ { code: "GE", name: "Georgia" },
1047
+ { code: "DE", name: "Germany" },
1048
+ { code: "GH", name: "Ghana" },
1049
+ { code: "GR", name: "Greece" },
1050
+ { code: "GT", name: "Guatemala" },
1051
+ { code: "HN", name: "Honduras" },
1052
+ { code: "HK", name: "Hong Kong" },
1053
+ { code: "HU", name: "Hungary" },
1054
+ { code: "IS", name: "Iceland" },
1055
+ { code: "IN", name: "India" },
1056
+ { code: "ID", name: "Indonesia" },
1057
+ { code: "IR", name: "Iran" },
1058
+ { code: "IQ", name: "Iraq" },
1059
+ { code: "IE", name: "Ireland" },
1060
+ { code: "IL", name: "Israel" },
1061
+ { code: "IT", name: "Italy" },
1062
+ { code: "JM", name: "Jamaica" },
1063
+ { code: "JP", name: "Japan" },
1064
+ { code: "JO", name: "Jordan" },
1065
+ { code: "KZ", name: "Kazakhstan" },
1066
+ { code: "KE", name: "Kenya" },
1067
+ { code: "KW", name: "Kuwait" },
1068
+ { code: "LB", name: "Lebanon" },
1069
+ { code: "LY", name: "Libya" },
1070
+ { code: "MY", name: "Malaysia" },
1071
+ { code: "MX", name: "Mexico" },
1072
+ { code: "MA", name: "Morocco" },
1073
+ { code: "MZ", name: "Mozambique" },
1074
+ { code: "NP", name: "Nepal" },
1075
+ { code: "NL", name: "Netherlands" },
1076
+ { code: "NZ", name: "New Zealand" },
1077
+ { code: "NI", name: "Nicaragua" },
1078
+ { code: "NG", name: "Nigeria" },
1079
+ { code: "NO", name: "Norway" },
1080
+ { code: "PK", name: "Pakistan" },
1081
+ { code: "PA", name: "Panama" },
1082
+ { code: "PY", name: "Paraguay" },
1083
+ { code: "PE", name: "Peru" },
1084
+ { code: "PH", name: "Philippines" },
1085
+ { code: "PL", name: "Poland" },
1086
+ { code: "PT", name: "Portugal" },
1087
+ { code: "QA", name: "Qatar" },
1088
+ { code: "RO", name: "Romania" },
1089
+ { code: "RU", name: "Russia" },
1090
+ { code: "SA", name: "Saudi Arabia" },
1091
+ { code: "SN", name: "Senegal" },
1092
+ { code: "RS", name: "Serbia" },
1093
+ { code: "SG", name: "Singapore" },
1094
+ { code: "ZA", name: "South Africa" },
1095
+ { code: "KR", name: "South Korea" },
1096
+ { code: "ES", name: "Spain" },
1097
+ { code: "LK", name: "Sri Lanka" },
1098
+ { code: "SE", name: "Sweden" },
1099
+ { code: "CH", name: "Switzerland" },
1100
+ { code: "TW", name: "Taiwan" },
1101
+ { code: "TZ", name: "Tanzania" },
1102
+ { code: "TH", name: "Thailand" },
1103
+ { code: "TN", name: "Tunisia" },
1104
+ { code: "TR", name: "Turkey" },
1105
+ { code: "UA", name: "Ukraine" },
1106
+ { code: "AE", name: "United Arab Emirates" },
1107
+ { code: "GB", name: "United Kingdom" },
1108
+ { code: "US", name: "United States" },
1109
+ { code: "UY", name: "Uruguay" },
1110
+ { code: "UZ", name: "Uzbekistan" },
1111
+ { code: "VE", name: "Venezuela" },
1112
+ { code: "VN", name: "Vietnam" },
1113
+ { code: "YE", name: "Yemen" },
1114
+ { code: "ZW", name: "Zimbabwe" }
1115
+ ];
1116
+ function CountrySearchField({
1117
+ value,
1118
+ onChange,
1119
+ required,
1120
+ label = "Country",
1121
+ countries,
1122
+ placeholder = "Search country\u2026",
1123
+ className
1124
+ }) {
1125
+ var _a;
1126
+ const list = countries != null ? countries : COUNTRIES;
1127
+ const [query, setQuery] = React21__namespace.useState("");
1128
+ const [open, setOpen] = React21__namespace.useState(false);
1129
+ const containerRef = React21__namespace.useRef(null);
1130
+ const searchRef = React21__namespace.useRef(null);
1131
+ const selected = list.find((c) => c.code === value);
1132
+ const isFloated = open || !!selected;
1133
+ const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
1134
+ React21__namespace.useEffect(() => {
1135
+ if (!open) return;
1136
+ const handler = (e) => {
1137
+ var _a2;
1138
+ if (!((_a2 = containerRef.current) == null ? void 0 : _a2.contains(e.target))) {
1139
+ setOpen(false);
1140
+ setQuery("");
1141
+ }
1142
+ };
1143
+ document.addEventListener("mousedown", handler);
1144
+ return () => document.removeEventListener("mousedown", handler);
1145
+ }, [open]);
1146
+ const handleOpen = () => {
1147
+ setOpen(true);
1148
+ setQuery("");
1149
+ setTimeout(() => {
1150
+ var _a2;
1151
+ return (_a2 = searchRef.current) == null ? void 0 : _a2.focus();
1152
+ }, 0);
1047
1153
  };
1048
1154
  const handleSelect = (code) => {
1049
1155
  onChange(code);
@@ -1132,7 +1238,7 @@ function Alert({ variant = "info", children, className }) {
1132
1238
  function AdventureCard({ adventure }) {
1133
1239
  var _a, _b, _c, _d, _e, _f;
1134
1240
  const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
1135
- const [checkedInternal, setCheckedInternal] = React19__namespace.useState(
1241
+ const [checkedInternal, setCheckedInternal] = React21__namespace.useState(
1136
1242
  new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
1137
1243
  );
1138
1244
  const isChecked = (opt) => {
@@ -1450,129 +1556,26 @@ function OfferSummarySection({
1450
1556
  )
1451
1557
  ] });
1452
1558
  }
1453
- function BirthDateField({
1454
- label,
1455
- required,
1456
- value,
1457
- onChange
1458
- }) {
1459
- const [open, setOpen] = React19__namespace.useState(false);
1460
- const [text, setText] = React19__namespace.useState(value ? dateFns.format(value, "dd/MM/yyyy") : "");
1461
- const containerRef = React19__namespace.useRef(null);
1462
- const inputId = React19__namespace.useId();
1463
- React19__namespace.useEffect(() => {
1464
- setText(value ? dateFns.format(value, "dd/MM/yyyy") : "");
1465
- }, [value]);
1466
- React19__namespace.useEffect(() => {
1467
- if (!open) return;
1468
- const handler = (e) => {
1469
- var _a;
1470
- if (!((_a = containerRef.current) == null ? void 0 : _a.contains(e.target))) setOpen(false);
1471
- };
1472
- document.addEventListener("mousedown", handler);
1473
- return () => document.removeEventListener("mousedown", handler);
1474
- }, [open]);
1475
- const handleTextChange = (e) => {
1476
- const digits = e.target.value.replace(/\D/g, "").slice(0, 8);
1477
- let formatted = digits.slice(0, 2);
1478
- if (digits.length > 2) formatted += "/" + digits.slice(2, 4);
1479
- if (digits.length > 4) formatted += "/" + digits.slice(4, 8);
1480
- setText(formatted);
1481
- if (formatted.length === 10) {
1482
- const [dd, mm, yyyy] = formatted.split("/").map(Number);
1483
- const d = new Date(yyyy, mm - 1, dd);
1484
- if (!isNaN(d.getTime()) && d.getFullYear() === yyyy && d <= /* @__PURE__ */ new Date()) {
1485
- onChange(d);
1486
- return;
1487
- }
1488
- }
1489
- onChange(void 0);
1490
- };
1491
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "relative w-full", children: [
1492
- /* @__PURE__ */ jsxRuntime.jsxs(
1493
- "div",
1494
- {
1495
- className: cn(
1496
- "flex items-center rounded-lg border border-border bg-background h-14 transition-colors",
1497
- open ? "border-primary ring-1 ring-primary" : "focus-within:border-primary focus-within:ring-1 focus-within:ring-primary"
1498
- ),
1499
- children: [
1500
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 h-full", children: [
1501
- /* @__PURE__ */ jsxRuntime.jsxs(
1502
- "label",
1503
- {
1504
- htmlFor: inputId,
1505
- className: "pointer-events-none absolute left-3 top-2 text-xs text-muted-foreground font-ui",
1506
- children: [
1507
- label,
1508
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
1509
- ]
1510
- }
1511
- ),
1512
- /* @__PURE__ */ jsxRuntime.jsx(
1513
- "input",
1514
- {
1515
- id: inputId,
1516
- type: "text",
1517
- inputMode: "numeric",
1518
- value: text,
1519
- onChange: handleTextChange,
1520
- placeholder: "dd/mm/yyyy",
1521
- className: "block h-full w-full bg-transparent px-3 pt-5 pb-2 text-base text-foreground font-ui focus:outline-none placeholder:text-muted-foreground/50"
1522
- }
1523
- )
1524
- ] }),
1525
- /* @__PURE__ */ jsxRuntime.jsx(
1526
- "button",
1527
- {
1528
- type: "button",
1529
- onClick: () => setOpen((v) => !v),
1530
- tabIndex: -1,
1531
- "aria-label": "Open calendar",
1532
- className: "px-3 h-full flex items-center text-muted-foreground hover:text-primary transition-colors focus:outline-none",
1533
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "h-4 w-4" })
1534
- }
1535
- )
1536
- ]
1537
- }
1538
- ),
1539
- open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-[calc(100%+4px)] left-0 right-0 z-50 rounded-xl border border-border bg-background shadow-lg overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
1540
- Calendar,
1541
- {
1542
- mode: "single",
1543
- selected: value,
1544
- onSelect: (date) => {
1545
- onChange(date);
1546
- setOpen(false);
1547
- },
1548
- defaultMonth: value != null ? value : new Date(1990, 0, 1),
1549
- disabled: { after: /* @__PURE__ */ new Date() },
1550
- className: "font-ui w-full",
1551
- autoFocus: true
1552
- }
1553
- ) })
1554
- ] });
1555
- }
1556
- function BookingShell({
1557
- steps,
1558
- currentStep,
1559
- title = "Booking details",
1560
- children,
1561
- onNext,
1562
- onBack,
1563
- onCancel,
1564
- nextLabel = "Next",
1565
- backLabel = "Back",
1566
- cancelLabel = "Cancel",
1567
- nextDisabled,
1568
- nextBlockedMessage,
1569
- error,
1570
- successMessage
1559
+ function BookingShell({
1560
+ steps,
1561
+ currentStep,
1562
+ title = "Booking details",
1563
+ children,
1564
+ onNext,
1565
+ onBack,
1566
+ onCancel,
1567
+ nextLabel = "Next",
1568
+ backLabel = "Back",
1569
+ cancelLabel = "Cancel",
1570
+ nextDisabled,
1571
+ nextBlockedMessage,
1572
+ error,
1573
+ successMessage
1571
1574
  }) {
1572
1575
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden", children: [
1573
1576
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border px-5 py-4 bg-muted/20", children: [
1574
1577
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground font-heading mb-2", children: title }),
1575
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(React19__namespace.Fragment, { children: [
1578
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
1576
1579
  /* @__PURE__ */ jsxRuntime.jsx(
1577
1580
  "span",
1578
1581
  {
@@ -1770,7 +1773,7 @@ function TermsSection({
1770
1773
  locale = "en"
1771
1774
  }) {
1772
1775
  var _a;
1773
- const [modalOpen, setModalOpen] = React19__namespace.useState(false);
1776
+ const [modalOpen, setModalOpen] = React21__namespace.useState(false);
1774
1777
  const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
1775
1778
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
1776
1779
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
@@ -1858,9 +1861,9 @@ function BookingWizard({
1858
1861
  depositInfo,
1859
1862
  onCancel
1860
1863
  }) {
1861
- const [step, setStep] = React19__namespace.useState("responsible");
1862
- const [error, setError] = React19__namespace.useState(null);
1863
- const [responsible, setResponsible] = React19__namespace.useState({
1864
+ const [step, setStep] = React21__namespace.useState("responsible");
1865
+ const [error, setError] = React21__namespace.useState(null);
1866
+ const [responsible, setResponsible] = React21__namespace.useState({
1864
1867
  firstName: "",
1865
1868
  lastName: "",
1866
1869
  email: "",
@@ -1879,7 +1882,7 @@ function BookingWizard({
1879
1882
  return s + ((_b = (_a = a.slots) == null ? void 0 : _a.children) != null ? _b : 0);
1880
1883
  }, 0);
1881
1884
  const totalPax = totalAdults + totalChildren;
1882
- const [travellers, setTravellers] = React19__namespace.useState(
1885
+ const [travellers, setTravellers] = React21__namespace.useState(
1883
1886
  Array.from({ length: Math.max(totalPax, 1) }, () => ({
1884
1887
  firstName: "",
1885
1888
  lastName: "",
@@ -1887,9 +1890,9 @@ function BookingWizard({
1887
1890
  email: ""
1888
1891
  }))
1889
1892
  );
1890
- const [payAmount, setPayAmount] = React19__namespace.useState("full");
1891
- const [payMethod, setPayMethod] = React19__namespace.useState("stripe");
1892
- const [termsAccepted, setTermsAccepted] = React19__namespace.useState(false);
1893
+ const [payAmount, setPayAmount] = React21__namespace.useState("full");
1894
+ const [payMethod, setPayMethod] = React21__namespace.useState("stripe");
1895
+ const [termsAccepted, setTermsAccepted] = React21__namespace.useState(false);
1893
1896
  const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
1894
1897
  const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
1895
1898
  const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
@@ -2090,7 +2093,7 @@ function Offer({
2090
2093
  continueDisabled,
2091
2094
  className
2092
2095
  }) {
2093
- const [showBooking, setShowBooking] = React19__namespace.useState(false);
2096
+ const [showBooking, setShowBooking] = React21__namespace.useState(false);
2094
2097
  const isShowingCheckout = !!checkoutSlot || showBooking;
2095
2098
  const handleBook = () => {
2096
2099
  if (!checkoutSlot && !externalBookingFlow) setShowBooking(true);
@@ -2212,9 +2215,9 @@ function AdventureSection({
2212
2215
  onAddSuggestedTraveller
2213
2216
  }) {
2214
2217
  var _a, _b, _c;
2215
- const [detailsOpen, setDetailsOpen] = React19__namespace.useState(false);
2216
- const [addModalOpen, setAddModalOpen] = React19__namespace.useState(false);
2217
- const [newTraveller, setNewTraveller] = React19__namespace.useState({
2218
+ const [detailsOpen, setDetailsOpen] = React21__namespace.useState(false);
2219
+ const [addModalOpen, setAddModalOpen] = React21__namespace.useState(false);
2220
+ const [newTraveller, setNewTraveller] = React21__namespace.useState({
2218
2221
  firstName: "",
2219
2222
  lastName: "",
2220
2223
  passport: "",
@@ -3334,465 +3337,1208 @@ function BookingConfirmationEmail({
3334
3337
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "py-1 pr-4 text-muted-foreground font-ui", children: l.hostLabel }),
3335
3338
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "py-1 font-medium text-foreground", children: host })
3336
3339
  ] })
3337
- ] }) }),
3338
- /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-t border-border mb-8" }),
3339
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4", children: l.postCtaMessage }),
3340
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: l.closingMessage })
3341
- ]
3342
- }
3343
- );
3344
- }
3345
- function CounterField({
3346
- label,
3347
- sublabel,
3348
- required,
3349
- value,
3350
- min = 0,
3351
- max = 99,
3352
- onChange,
3353
- className
3354
- }) {
3355
- const decrement = () => {
3356
- if (value > min) onChange(value - 1);
3357
- };
3358
- const increment = () => {
3359
- if (value < max) onChange(value + 1);
3360
- };
3361
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
3362
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-ui text-foreground", children: [
3363
- label,
3364
- sublabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground font-normal ml-1", children: sublabel }),
3365
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
3366
- ] }),
3367
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between rounded-lg border border-border bg-background px-4 py-3 h-14", children: [
3368
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl font-semibold text-foreground tabular-nums w-8 font-ui", children: value }),
3369
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3370
- /* @__PURE__ */ jsxRuntime.jsx(
3371
- "button",
3372
- {
3373
- type: "button",
3374
- onClick: decrement,
3375
- disabled: value <= min,
3376
- "aria-label": `Diminuir ${label}`,
3377
- className: cn(
3378
- "inline-flex h-8 w-8 items-center justify-center rounded-full border border-border",
3379
- "text-foreground transition-colors",
3380
- "hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3381
- "disabled:pointer-events-none disabled:opacity-30"
3382
- ),
3383
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, { className: "h-3.5 w-3.5" })
3384
- }
3385
- ),
3386
- /* @__PURE__ */ jsxRuntime.jsx(
3340
+ ] }) }),
3341
+ /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-t border-border mb-8" }),
3342
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4", children: l.postCtaMessage }),
3343
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: l.closingMessage })
3344
+ ]
3345
+ }
3346
+ );
3347
+ }
3348
+ function CounterField({
3349
+ label,
3350
+ sublabel,
3351
+ required,
3352
+ value,
3353
+ min = 0,
3354
+ max = 99,
3355
+ onChange,
3356
+ className
3357
+ }) {
3358
+ const decrement = () => {
3359
+ if (value > min) onChange(value - 1);
3360
+ };
3361
+ const increment = () => {
3362
+ if (value < max) onChange(value + 1);
3363
+ };
3364
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
3365
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-ui text-foreground", children: [
3366
+ label,
3367
+ sublabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground font-normal ml-1", children: sublabel }),
3368
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
3369
+ ] }),
3370
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between rounded-lg border border-border bg-background px-4 py-3 h-14", children: [
3371
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl font-semibold text-foreground tabular-nums w-8 font-ui", children: value }),
3372
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
3373
+ /* @__PURE__ */ jsxRuntime.jsx(
3374
+ "button",
3375
+ {
3376
+ type: "button",
3377
+ onClick: decrement,
3378
+ disabled: value <= min,
3379
+ "aria-label": `Diminuir ${label}`,
3380
+ className: cn(
3381
+ "inline-flex h-8 w-8 items-center justify-center rounded-full border border-border",
3382
+ "text-foreground transition-colors",
3383
+ "hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3384
+ "disabled:pointer-events-none disabled:opacity-30"
3385
+ ),
3386
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, { className: "h-3.5 w-3.5" })
3387
+ }
3388
+ ),
3389
+ /* @__PURE__ */ jsxRuntime.jsx(
3390
+ "button",
3391
+ {
3392
+ type: "button",
3393
+ onClick: increment,
3394
+ disabled: value >= max,
3395
+ "aria-label": `Aumentar ${label}`,
3396
+ className: cn(
3397
+ "inline-flex h-8 w-8 items-center justify-center rounded-full border border-border",
3398
+ "text-foreground transition-colors",
3399
+ "hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3400
+ "disabled:pointer-events-none disabled:opacity-30"
3401
+ ),
3402
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "h-3.5 w-3.5" })
3403
+ }
3404
+ )
3405
+ ] })
3406
+ ] })
3407
+ ] });
3408
+ }
3409
+ function Popover(_a) {
3410
+ var props = __objRest(_a, []);
3411
+ return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
3412
+ }
3413
+ function PopoverTrigger(_a) {
3414
+ var props = __objRest(_a, []);
3415
+ return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
3416
+ }
3417
+ function PopoverContent(_a) {
3418
+ var _b = _a, {
3419
+ className,
3420
+ align = "center",
3421
+ alignOffset = 0,
3422
+ side = "bottom",
3423
+ sideOffset = 4
3424
+ } = _b, props = __objRest(_b, [
3425
+ "className",
3426
+ "align",
3427
+ "alignOffset",
3428
+ "side",
3429
+ "sideOffset"
3430
+ ]);
3431
+ return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
3432
+ popover.Popover.Positioner,
3433
+ {
3434
+ align,
3435
+ alignOffset,
3436
+ side,
3437
+ sideOffset,
3438
+ className: "isolate z-50",
3439
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3440
+ popover.Popover.Popup,
3441
+ __spreadValues({
3442
+ "data-slot": "popover-content",
3443
+ className: cn(
3444
+ "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
3445
+ className
3446
+ )
3447
+ }, props)
3448
+ )
3449
+ }
3450
+ ) });
3451
+ }
3452
+ function DatePickerField({
3453
+ label,
3454
+ required,
3455
+ value,
3456
+ onChange,
3457
+ placeholder = "Select a date",
3458
+ disabled,
3459
+ fromDate,
3460
+ className
3461
+ }) {
3462
+ const [open, setOpen] = React21__namespace.useState(false);
3463
+ const containerRef = React21__namespace.useRef(null);
3464
+ const [calendarWidth, setCalendarWidth] = React21__namespace.useState();
3465
+ const hasValue = !!value;
3466
+ React21__namespace.useEffect(() => {
3467
+ if (!containerRef.current) return;
3468
+ const observer = new ResizeObserver(([entry]) => {
3469
+ setCalendarWidth(entry.contentRect.width);
3470
+ });
3471
+ observer.observe(containerRef.current);
3472
+ return () => observer.disconnect();
3473
+ }, []);
3474
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: cn("w-full", className), children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
3475
+ /* @__PURE__ */ jsxRuntime.jsxs(
3476
+ PopoverTrigger,
3477
+ {
3478
+ disabled,
3479
+ className: cn(
3480
+ "relative flex w-full items-center rounded-lg border border-border bg-background",
3481
+ "px-3 text-left text-base font-ui transition-colors h-14",
3482
+ "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",
3483
+ "disabled:pointer-events-none disabled:opacity-50",
3484
+ open && "border-primary ring-1 ring-primary"
3485
+ ),
3486
+ children: [
3487
+ /* @__PURE__ */ jsxRuntime.jsxs(
3488
+ "span",
3489
+ {
3490
+ className: cn(
3491
+ "pointer-events-none absolute left-3 transition-all duration-150 font-ui",
3492
+ hasValue || open ? "top-2 text-xs text-primary" : "top-1/2 -translate-y-1/2 text-base text-muted-foreground"
3493
+ ),
3494
+ children: [
3495
+ label,
3496
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
3497
+ ]
3498
+ }
3499
+ ),
3500
+ /* @__PURE__ */ jsxRuntime.jsx(
3501
+ "span",
3502
+ {
3503
+ className: cn(
3504
+ "flex-1 truncate mt-3",
3505
+ hasValue ? "text-foreground" : "invisible"
3506
+ ),
3507
+ children: hasValue ? dateFns.format(value, "dd MMM yyyy") : placeholder
3508
+ }
3509
+ ),
3510
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "ml-2 h-4 w-4 shrink-0 text-muted-foreground" })
3511
+ ]
3512
+ }
3513
+ ),
3514
+ /* @__PURE__ */ jsxRuntime.jsx(
3515
+ PopoverContent,
3516
+ {
3517
+ className: "p-0",
3518
+ align: "start",
3519
+ style: calendarWidth ? { width: calendarWidth } : void 0,
3520
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3521
+ Calendar,
3522
+ {
3523
+ mode: "single",
3524
+ selected: value,
3525
+ onSelect: (date) => {
3526
+ onChange == null ? void 0 : onChange(date);
3527
+ setOpen(false);
3528
+ },
3529
+ fromDate: fromDate != null ? fromDate : /* @__PURE__ */ new Date(),
3530
+ className: "font-ui w-full",
3531
+ autoFocus: true
3532
+ }
3533
+ )
3534
+ }
3535
+ )
3536
+ ] }) });
3537
+ }
3538
+ function FormSection({
3539
+ title,
3540
+ children,
3541
+ className
3542
+ }) {
3543
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-5", className), children: [
3544
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
3545
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground whitespace-nowrap font-heading", children: title }),
3546
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-border" })
3547
+ ] }),
3548
+ children
3549
+ ] });
3550
+ }
3551
+ var defaultInitial = {
3552
+ adults: 2,
3553
+ children: 0,
3554
+ travelDate: void 0,
3555
+ budget: "",
3556
+ project: "",
3557
+ civility: "",
3558
+ phoneCountry: "BR",
3559
+ lastName: "",
3560
+ firstName: "",
3561
+ country: "France",
3562
+ phone: "",
3563
+ email: ""
3564
+ };
3565
+ function BookingForm({
3566
+ defaultValues,
3567
+ onSubmit,
3568
+ submitLabel = "Send my request",
3569
+ loading = false,
3570
+ showHeader = true,
3571
+ title = "Check availability for your trip",
3572
+ subtitle = "Free enquiry \u2013 no commitment",
3573
+ className
3574
+ }) {
3575
+ const [values, setValues] = React21__namespace.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
3576
+ const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
3577
+ const handleSubmit = (e) => {
3578
+ e.preventDefault();
3579
+ onSubmit == null ? void 0 : onSubmit(values);
3580
+ };
3581
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3582
+ "form",
3583
+ {
3584
+ onSubmit: handleSubmit,
3585
+ className: cn("flex flex-col gap-10", className),
3586
+ noValidate: true,
3587
+ children: [
3588
+ showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3589
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
3590
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-sm text-muted-foreground font-ui", children: subtitle })
3591
+ ] }),
3592
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection, { title: "Who's joining the adventure?", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
3593
+ /* @__PURE__ */ jsxRuntime.jsx(
3594
+ CounterField,
3595
+ {
3596
+ label: "Adults",
3597
+ required: true,
3598
+ value: values.adults,
3599
+ min: 1,
3600
+ onChange: (v) => set("adults", v)
3601
+ }
3602
+ ),
3603
+ /* @__PURE__ */ jsxRuntime.jsx(
3604
+ CounterField,
3605
+ {
3606
+ label: "Children",
3607
+ sublabel: "(under 12)",
3608
+ value: values.children,
3609
+ min: 0,
3610
+ onChange: (v) => set("children", v)
3611
+ }
3612
+ )
3613
+ ] }) }),
3614
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection, { title: "Your next trip", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
3615
+ /* @__PURE__ */ jsxRuntime.jsx(
3616
+ DatePickerField,
3617
+ {
3618
+ label: "Travel date",
3619
+ required: true,
3620
+ value: values.travelDate,
3621
+ onChange: (d) => set("travelDate", d),
3622
+ placeholder: "Pick a date"
3623
+ }
3624
+ ),
3625
+ /* @__PURE__ */ jsxRuntime.jsx(
3626
+ FloatingInput,
3627
+ {
3628
+ label: "Budget (per person)",
3629
+ required: true,
3630
+ type: "number",
3631
+ min: 0,
3632
+ value: values.budget,
3633
+ onChange: (e) => set("budget", e.target.value)
3634
+ }
3635
+ )
3636
+ ] }) }),
3637
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection, { title: "Tell us about your trip", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3638
+ /* @__PURE__ */ jsxRuntime.jsx(
3639
+ "textarea",
3640
+ {
3641
+ id: "project",
3642
+ placeholder: " ",
3643
+ rows: 5,
3644
+ value: values.project,
3645
+ onChange: (e) => set("project", e.target.value),
3646
+ className: cn(
3647
+ "peer block w-full resize-none rounded-lg border border-border bg-background",
3648
+ "px-3 pt-6 pb-3 text-base text-foreground font-ui",
3649
+ "transition-colors placeholder-transparent",
3650
+ "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"
3651
+ )
3652
+ }
3653
+ ),
3654
+ /* @__PURE__ */ jsxRuntime.jsxs(
3655
+ "label",
3656
+ {
3657
+ htmlFor: "project",
3658
+ className: cn(
3659
+ "pointer-events-none absolute left-3 top-4",
3660
+ "text-base text-muted-foreground font-ui transition-all duration-150",
3661
+ "peer-focus:top-2 peer-focus:text-xs peer-focus:text-primary",
3662
+ "peer-not-placeholder-shown:top-2 peer-not-placeholder-shown:text-xs peer-not-placeholder-shown:text-muted-foreground"
3663
+ ),
3664
+ children: [
3665
+ "Your trip in a few words",
3666
+ " ",
3667
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
3668
+ ]
3669
+ }
3670
+ )
3671
+ ] }) }),
3672
+ /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { title: "Contact details", children: [
3673
+ /* @__PURE__ */ jsxRuntime.jsx(
3674
+ "div",
3675
+ {
3676
+ role: "radiogroup",
3677
+ "aria-label": "Title",
3678
+ className: "flex flex-wrap items-center gap-x-6 gap-y-3",
3679
+ children: ["ms", "mr"].map((c) => /* @__PURE__ */ jsxRuntime.jsxs(
3680
+ "label",
3681
+ {
3682
+ className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-foreground",
3683
+ children: [
3684
+ /* @__PURE__ */ jsxRuntime.jsx(
3685
+ "input",
3686
+ {
3687
+ type: "radio",
3688
+ name: "civility",
3689
+ value: c,
3690
+ checked: values.civility === c,
3691
+ onChange: () => set("civility", c),
3692
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
3693
+ }
3694
+ ),
3695
+ c === "ms" ? "Ms." : "Mr."
3696
+ ]
3697
+ },
3698
+ c
3699
+ ))
3700
+ }
3701
+ ),
3702
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 min-w-0", children: [
3703
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3704
+ FloatingInput,
3705
+ {
3706
+ label: "Last name",
3707
+ required: true,
3708
+ value: values.lastName,
3709
+ onChange: (e) => set("lastName", e.target.value)
3710
+ }
3711
+ ) }),
3712
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3713
+ FloatingInput,
3714
+ {
3715
+ label: "First name",
3716
+ required: true,
3717
+ value: values.firstName,
3718
+ onChange: (e) => set("firstName", e.target.value)
3719
+ }
3720
+ ) }),
3721
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 sm:col-span-2 lg:col-span-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
3722
+ FloatingSelect,
3723
+ {
3724
+ label: "Country of residence",
3725
+ required: true,
3726
+ value: values.country,
3727
+ onChange: (e) => set("country", e.target.value),
3728
+ children: [
3729
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, hidden: true }),
3730
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "France", children: "France" }),
3731
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Belgium", children: "Belgium" }),
3732
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Switzerland", children: "Switzerland" }),
3733
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Canada", children: "Canada" }),
3734
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Luxembourg", children: "Luxembourg" }),
3735
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "United Kingdom", children: "United Kingdom" }),
3736
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "United States", children: "United States" }),
3737
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Other", children: "Other" })
3738
+ ]
3739
+ }
3740
+ ) })
3741
+ ] }),
3742
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
3743
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full min-w-0", children: [
3744
+ /* @__PURE__ */ jsxRuntime.jsx(
3745
+ PhoneCountrySelect,
3746
+ {
3747
+ value: values.phoneCountry,
3748
+ onChange: (code) => set("phoneCountry", code),
3749
+ className: "shrink-0"
3750
+ }
3751
+ ),
3752
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-w-0 flex-1", children: [
3753
+ /* @__PURE__ */ jsxRuntime.jsx(
3754
+ "input",
3755
+ {
3756
+ id: "phone",
3757
+ type: "tel",
3758
+ placeholder: " ",
3759
+ value: values.phone,
3760
+ onChange: (e) => set("phone", e.target.value),
3761
+ className: cn(
3762
+ "peer block h-14 w-full rounded-r-lg border border-border bg-background",
3763
+ "px-3 pt-5 pb-2 text-base text-foreground font-ui",
3764
+ "transition-colors placeholder-transparent",
3765
+ "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"
3766
+ )
3767
+ }
3768
+ ),
3769
+ /* @__PURE__ */ jsxRuntime.jsxs(
3770
+ "label",
3771
+ {
3772
+ htmlFor: "phone",
3773
+ className: cn(
3774
+ "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2",
3775
+ "text-base text-muted-foreground font-ui transition-all duration-150",
3776
+ "peer-focus:top-3 peer-focus:translate-y-0 peer-focus:text-xs peer-focus:text-primary",
3777
+ "peer-not-placeholder-shown:top-3 peer-not-placeholder-shown:translate-y-0 peer-not-placeholder-shown:text-xs peer-not-placeholder-shown:text-muted-foreground"
3778
+ ),
3779
+ children: [
3780
+ "Phone ",
3781
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "*" })
3782
+ ]
3783
+ }
3784
+ )
3785
+ ] })
3786
+ ] }),
3787
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3788
+ FloatingInput,
3789
+ {
3790
+ label: "Email",
3791
+ required: true,
3792
+ type: "email",
3793
+ value: values.email,
3794
+ onChange: (e) => set("email", e.target.value)
3795
+ }
3796
+ ) })
3797
+ ] })
3798
+ ] }),
3799
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
3387
3800
  "button",
3388
3801
  {
3389
- type: "button",
3390
- onClick: increment,
3391
- disabled: value >= max,
3392
- "aria-label": `Aumentar ${label}`,
3802
+ type: "submit",
3803
+ disabled: loading,
3393
3804
  className: cn(
3394
- "inline-flex h-8 w-8 items-center justify-center rounded-full border border-border",
3395
- "text-foreground transition-colors",
3396
- "hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
3397
- "disabled:pointer-events-none disabled:opacity-30"
3805
+ "inline-flex items-center justify-center gap-2 rounded-full px-10 py-3.5",
3806
+ "bg-primary text-primary-foreground font-ui font-semibold text-sm",
3807
+ "transition-colors hover:bg-primary/90 focus-visible:outline-none",
3808
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
3809
+ "disabled:pointer-events-none disabled:opacity-60"
3398
3810
  ),
3399
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "h-3.5 w-3.5" })
3811
+ children: loading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3812
+ /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
3813
+ /* @__PURE__ */ jsxRuntime.jsx(
3814
+ "circle",
3815
+ {
3816
+ className: "opacity-25",
3817
+ cx: "12",
3818
+ cy: "12",
3819
+ r: "10",
3820
+ stroke: "currentColor",
3821
+ strokeWidth: "4"
3822
+ }
3823
+ ),
3824
+ /* @__PURE__ */ jsxRuntime.jsx(
3825
+ "path",
3826
+ {
3827
+ className: "opacity-75",
3828
+ fill: "currentColor",
3829
+ d: "M4 12a8 8 0 018-8v4l3-3-3-3v4a8 8 0 00-8 8h4z"
3830
+ }
3831
+ )
3832
+ ] }),
3833
+ "Sending\u2026"
3834
+ ] }) : submitLabel
3400
3835
  }
3401
- )
3402
- ] })
3403
- ] })
3404
- ] });
3836
+ ) })
3837
+ ]
3838
+ }
3839
+ );
3405
3840
  }
3406
- function Popover(_a) {
3407
- var props = __objRest(_a, []);
3408
- return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Root, __spreadValues({ "data-slot": "popover" }, props));
3841
+ var DEFAULT_LABELS3 = {
3842
+ formSubtitle: "Free enquiry \u2013 no commitment",
3843
+ detailsSectionTitle: "Your details",
3844
+ tripInfoSectionTitle: "Trip info",
3845
+ termsSectionTitle: "Terms & conditions",
3846
+ termsAccept: "I read and accept the terms",
3847
+ termsDecline: "I decline",
3848
+ submitButton: "Submit answers",
3849
+ submitting: "Sending\u2026",
3850
+ adventureLabel: "Adventure",
3851
+ bookingLabel: "Booking",
3852
+ partnerLabel: "Partner",
3853
+ travellerLabel: "Traveller",
3854
+ firstNameLabel: "First name",
3855
+ lastNameLabel: "Last name",
3856
+ phoneLabel: "Phone",
3857
+ emergencyContactFirstName: "Contact first name",
3858
+ emergencyContactLastName: "Contact last name",
3859
+ emergencyContactPhoneLabel: "Contact phone",
3860
+ nationalityLabel: "Nationality",
3861
+ selectPlaceholder: "Select an option\u2026",
3862
+ optionalLabel: "(optional)"
3863
+ };
3864
+ var TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
3865
+ function emptyName() {
3866
+ return { firstName: "", lastName: "" };
3409
3867
  }
3410
- function PopoverTrigger(_a) {
3411
- var props = __objRest(_a, []);
3412
- return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Trigger, __spreadValues({ "data-slot": "popover-trigger" }, props));
3868
+ function emptyPhone(country) {
3869
+ return { country, nationalNumber: "" };
3413
3870
  }
3414
- function PopoverContent(_a) {
3415
- var _b = _a, {
3416
- className,
3417
- align = "center",
3418
- alignOffset = 0,
3419
- side = "bottom",
3420
- sideOffset = 4
3421
- } = _b, props = __objRest(_b, [
3422
- "className",
3423
- "align",
3424
- "alignOffset",
3425
- "side",
3426
- "sideOffset"
3427
- ]);
3428
- return /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
3429
- popover.Popover.Positioner,
3430
- {
3431
- align,
3432
- alignOffset,
3433
- side,
3434
- sideOffset,
3435
- className: "isolate z-50",
3436
- children: /* @__PURE__ */ jsxRuntime.jsx(
3437
- popover.Popover.Popup,
3438
- __spreadValues({
3439
- "data-slot": "popover-content",
3440
- className: cn(
3441
- "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
3442
- className
3443
- )
3444
- }, props)
3445
- )
3871
+ function emptyEmergency(country) {
3872
+ return { contactName: emptyName(), phone: emptyPhone(country) };
3873
+ }
3874
+ function asName(v) {
3875
+ if (v && typeof v === "object" && "firstName" in v && "lastName" in v) {
3876
+ const o = v;
3877
+ return {
3878
+ firstName: typeof o.firstName === "string" ? o.firstName : "",
3879
+ lastName: typeof o.lastName === "string" ? o.lastName : ""
3880
+ };
3881
+ }
3882
+ return emptyName();
3883
+ }
3884
+ function asPhone(v, defaultCountry) {
3885
+ if (v && typeof v === "object" && "country" in v && "nationalNumber" in v) {
3886
+ const o = v;
3887
+ return {
3888
+ country: typeof o.country === "string" ? o.country : defaultCountry,
3889
+ nationalNumber: typeof o.nationalNumber === "string" ? o.nationalNumber : ""
3890
+ };
3891
+ }
3892
+ return emptyPhone(defaultCountry);
3893
+ }
3894
+ function asEmergency(v, defaultCountry) {
3895
+ if (v && typeof v === "object" && "contactName" in v && "phone" in v) {
3896
+ const o = v;
3897
+ return {
3898
+ contactName: asName(o.contactName),
3899
+ phone: asPhone(o.phone, defaultCountry)
3900
+ };
3901
+ }
3902
+ return emptyEmergency(defaultCountry);
3903
+ }
3904
+ function asDate(v) {
3905
+ if (v instanceof Date && !Number.isNaN(v.getTime())) return v;
3906
+ if (typeof v === "string" && v.trim()) {
3907
+ const parsed = new Date(v);
3908
+ if (!Number.isNaN(parsed.getTime())) return parsed;
3909
+ }
3910
+ return void 0;
3911
+ }
3912
+ function initializeValues(fields, seed, defaultCountry, includeTerms) {
3913
+ var _a, _b;
3914
+ const next = {};
3915
+ for (const f of fields) {
3916
+ if (Object.prototype.hasOwnProperty.call(seed, f.id)) {
3917
+ next[f.id] = seed[f.id];
3918
+ continue;
3446
3919
  }
3447
- ) });
3920
+ switch (f.type) {
3921
+ case "name":
3922
+ next[f.id] = emptyName();
3923
+ break;
3924
+ case "phone":
3925
+ next[f.id] = emptyPhone(defaultCountry);
3926
+ break;
3927
+ case "emergencyContact":
3928
+ next[f.id] = emptyEmergency(defaultCountry);
3929
+ break;
3930
+ case "checkbox":
3931
+ next[f.id] = ((_b = (_a = f.options) == null ? void 0 : _a.length) != null ? _b : 0) > 0 ? [] : false;
3932
+ break;
3933
+ case "date":
3934
+ case "birthDate":
3935
+ next[f.id] = void 0;
3936
+ break;
3937
+ default:
3938
+ next[f.id] = "";
3939
+ }
3940
+ }
3941
+ if (includeTerms) next[TERMS_ACCEPT_KEY] = false;
3942
+ return next;
3448
3943
  }
3449
- function DatePickerField({
3450
- label,
3451
- required,
3452
- value,
3453
- onChange,
3454
- placeholder = "Select a date",
3455
- disabled,
3456
- fromDate,
3944
+ function formatDateRange(adventure, fmt) {
3945
+ var _a, _b;
3946
+ if (!(adventure == null ? void 0 : adventure.startDate) && !(adventure == null ? void 0 : adventure.endDate)) return null;
3947
+ const start = fmt ? fmt(adventure.startDate) : (_a = adventure.startDate) != null ? _a : "";
3948
+ const end = fmt ? fmt(adventure.endDate) : (_b = adventure.endDate) != null ? _b : "";
3949
+ if (start && end) return `${start} \u2014 ${end}`;
3950
+ return start || end || null;
3951
+ }
3952
+ function FormSection2({
3953
+ title,
3954
+ children,
3457
3955
  className
3458
3956
  }) {
3459
- const [open, setOpen] = React19__namespace.useState(false);
3460
- const containerRef = React19__namespace.useRef(null);
3461
- const [calendarWidth, setCalendarWidth] = React19__namespace.useState();
3462
- const hasValue = !!value;
3463
- React19__namespace.useEffect(() => {
3464
- if (!containerRef.current) return;
3465
- const observer = new ResizeObserver(([entry]) => {
3466
- setCalendarWidth(entry.contentRect.width);
3467
- });
3468
- observer.observe(containerRef.current);
3469
- return () => observer.disconnect();
3470
- }, []);
3471
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: cn("w-full", className), children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
3472
- /* @__PURE__ */ jsxRuntime.jsxs(
3473
- PopoverTrigger,
3957
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-5", className), children: [
3958
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
3959
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground whitespace-nowrap font-heading", children: title }),
3960
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-border" })
3961
+ ] }),
3962
+ children
3963
+ ] });
3964
+ }
3965
+ function PhoneInput({ id, label, required, value, onChange }) {
3966
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full min-w-0", children: [
3967
+ /* @__PURE__ */ jsxRuntime.jsx(
3968
+ PhoneCountrySelect,
3474
3969
  {
3475
- disabled,
3476
- className: cn(
3477
- "relative flex w-full items-center rounded-lg border border-border bg-background",
3478
- "px-3 text-left text-base font-ui transition-colors h-14",
3479
- "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",
3480
- "disabled:pointer-events-none disabled:opacity-50",
3481
- open && "border-primary ring-1 ring-primary"
3482
- ),
3483
- children: [
3484
- /* @__PURE__ */ jsxRuntime.jsxs(
3485
- "span",
3486
- {
3487
- className: cn(
3488
- "pointer-events-none absolute left-3 transition-all duration-150 font-ui",
3489
- hasValue || open ? "top-2 text-xs text-primary" : "top-1/2 -translate-y-1/2 text-base text-muted-foreground"
3490
- ),
3491
- children: [
3492
- label,
3493
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
3494
- ]
3495
- }
3496
- ),
3497
- /* @__PURE__ */ jsxRuntime.jsx(
3498
- "span",
3499
- {
3500
- className: cn(
3501
- "flex-1 truncate mt-3",
3502
- hasValue ? "text-foreground" : "invisible"
3503
- ),
3504
- children: hasValue ? dateFns.format(value, "dd MMM yyyy") : placeholder
3505
- }
3506
- ),
3507
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "ml-2 h-4 w-4 shrink-0 text-muted-foreground" })
3508
- ]
3970
+ value: value.country,
3971
+ onChange: (country) => onChange(__spreadProps(__spreadValues({}, value), { country })),
3972
+ className: "shrink-0"
3509
3973
  }
3510
3974
  ),
3975
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-w-0 flex-1", children: [
3976
+ /* @__PURE__ */ jsxRuntime.jsx(
3977
+ "input",
3978
+ {
3979
+ id,
3980
+ type: "tel",
3981
+ placeholder: " ",
3982
+ value: value.nationalNumber,
3983
+ required,
3984
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, value), { nationalNumber: e.target.value })),
3985
+ className: cn(
3986
+ "peer block h-14 w-full rounded-r-lg border border-border bg-background",
3987
+ "px-3 pt-5 pb-2 text-base text-foreground font-ui",
3988
+ "transition-colors placeholder-transparent",
3989
+ "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"
3990
+ )
3991
+ }
3992
+ ),
3993
+ /* @__PURE__ */ jsxRuntime.jsxs(
3994
+ "label",
3995
+ {
3996
+ htmlFor: id,
3997
+ className: cn(
3998
+ "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2",
3999
+ "text-base text-muted-foreground font-ui transition-all duration-150",
4000
+ "peer-focus:top-3 peer-focus:translate-y-0 peer-focus:text-xs peer-focus:text-primary",
4001
+ "peer-not-placeholder-shown:top-3 peer-not-placeholder-shown:translate-y-0 peer-not-placeholder-shown:text-xs peer-not-placeholder-shown:text-muted-foreground"
4002
+ ),
4003
+ children: [
4004
+ label,
4005
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4006
+ ]
4007
+ }
4008
+ )
4009
+ ] })
4010
+ ] });
4011
+ }
4012
+ function FloatingTextarea({
4013
+ id,
4014
+ label,
4015
+ required,
4016
+ optionalHint,
4017
+ value,
4018
+ onChange
4019
+ }) {
4020
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3511
4021
  /* @__PURE__ */ jsxRuntime.jsx(
3512
- PopoverContent,
4022
+ "textarea",
3513
4023
  {
3514
- className: "p-0",
3515
- align: "start",
3516
- style: calendarWidth ? { width: calendarWidth } : void 0,
3517
- children: /* @__PURE__ */ jsxRuntime.jsx(
3518
- Calendar,
3519
- {
3520
- mode: "single",
3521
- selected: value,
3522
- onSelect: (date) => {
3523
- onChange == null ? void 0 : onChange(date);
3524
- setOpen(false);
3525
- },
3526
- fromDate: fromDate != null ? fromDate : /* @__PURE__ */ new Date(),
3527
- className: "font-ui w-full",
3528
- autoFocus: true
3529
- }
4024
+ id,
4025
+ placeholder: " ",
4026
+ rows: 5,
4027
+ value,
4028
+ required,
4029
+ onChange: (e) => onChange(e.target.value),
4030
+ className: cn(
4031
+ "peer block w-full resize-none rounded-lg border border-border bg-background",
4032
+ "px-3 pt-6 pb-3 text-base text-foreground font-ui",
4033
+ "transition-colors placeholder-transparent",
4034
+ "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"
3530
4035
  )
3531
4036
  }
4037
+ ),
4038
+ /* @__PURE__ */ jsxRuntime.jsxs(
4039
+ "label",
4040
+ {
4041
+ htmlFor: id,
4042
+ className: cn(
4043
+ "pointer-events-none absolute left-3 top-4",
4044
+ "text-base text-muted-foreground font-ui transition-all duration-150",
4045
+ "peer-focus:top-2 peer-focus:text-xs peer-focus:text-primary",
4046
+ "peer-not-placeholder-shown:top-2 peer-not-placeholder-shown:text-xs peer-not-placeholder-shown:text-muted-foreground"
4047
+ ),
4048
+ children: [
4049
+ label,
4050
+ required ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" }) : optionalHint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-muted-foreground font-normal", children: optionalHint }) : null
4051
+ ]
4052
+ }
3532
4053
  )
3533
- ] }) });
3534
- }
3535
- function FormSection({
3536
- title,
3537
- children,
3538
- className
3539
- }) {
3540
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-5", className), children: [
3541
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
3542
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground whitespace-nowrap font-heading", children: title }),
3543
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-border" })
3544
- ] }),
3545
- children
3546
4054
  ] });
3547
4055
  }
3548
- var defaultInitial = {
3549
- adults: 2,
3550
- children: 0,
3551
- travelDate: void 0,
3552
- budget: "",
3553
- project: "",
3554
- civility: "",
3555
- phoneCountry: "BR",
3556
- lastName: "",
3557
- firstName: "",
3558
- country: "France",
3559
- phone: "",
3560
- email: ""
3561
- };
3562
- function BookingForm({
3563
- defaultValues,
3564
- onSubmit,
3565
- submitLabel = "Send my request",
3566
- loading = false,
3567
- showHeader = true,
3568
- title = "Check availability for your trip",
3569
- subtitle = "Free enquiry \u2013 no commitment",
3570
- className
4056
+ function FieldRenderer({
4057
+ field,
4058
+ value,
4059
+ onChange,
4060
+ defaultPhoneCountry,
4061
+ labels
3571
4062
  }) {
3572
- const [values, setValues] = React19__namespace.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
3573
- const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
3574
- const handleSubmit = (e) => {
3575
- e.preventDefault();
3576
- onSubmit == null ? void 0 : onSubmit(values);
3577
- };
3578
- return /* @__PURE__ */ jsxRuntime.jsxs(
3579
- "form",
3580
- {
3581
- onSubmit: handleSubmit,
3582
- className: cn("flex flex-col gap-10", className),
3583
- noValidate: true,
3584
- children: [
3585
- showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
3586
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
3587
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-sm text-muted-foreground font-ui", children: subtitle })
3588
- ] }),
3589
- /* @__PURE__ */ jsxRuntime.jsx(FormSection, { title: "Who's joining the adventure?", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
3590
- /* @__PURE__ */ jsxRuntime.jsx(
3591
- CounterField,
3592
- {
3593
- label: "Adults",
3594
- required: true,
3595
- value: values.adults,
3596
- min: 1,
3597
- onChange: (v) => set("adults", v)
3598
- }
3599
- ),
3600
- /* @__PURE__ */ jsxRuntime.jsx(
3601
- CounterField,
3602
- {
3603
- label: "Children",
3604
- sublabel: "(under 12)",
3605
- value: values.children,
3606
- min: 0,
3607
- onChange: (v) => set("children", v)
3608
- }
3609
- )
3610
- ] }) }),
3611
- /* @__PURE__ */ jsxRuntime.jsx(FormSection, { title: "Your next trip", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
4063
+ var _a, _b, _c;
4064
+ const fieldId = `rf-${field.id}`;
4065
+ if (field.type === "name") {
4066
+ const v = asName(value);
4067
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4068
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mb-3 text-sm font-ui font-medium text-foreground", children: [
4069
+ field.label,
4070
+ field.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4071
+ ] }),
4072
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
4073
+ /* @__PURE__ */ jsxRuntime.jsx(
4074
+ FloatingInput,
4075
+ {
4076
+ label: labels.firstNameLabel,
4077
+ required: field.required,
4078
+ value: v.firstName,
4079
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, v), { firstName: e.target.value }))
4080
+ }
4081
+ ),
4082
+ /* @__PURE__ */ jsxRuntime.jsx(
4083
+ FloatingInput,
4084
+ {
4085
+ label: labels.lastNameLabel,
4086
+ required: field.required,
4087
+ value: v.lastName,
4088
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, v), { lastName: e.target.value }))
4089
+ }
4090
+ )
4091
+ ] })
4092
+ ] });
4093
+ }
4094
+ if (field.type === "phone") {
4095
+ const v = asPhone(value, defaultPhoneCountry);
4096
+ return /* @__PURE__ */ jsxRuntime.jsx(
4097
+ PhoneInput,
4098
+ {
4099
+ id: fieldId,
4100
+ label: field.label,
4101
+ required: field.required,
4102
+ value: v,
4103
+ onChange
4104
+ }
4105
+ );
4106
+ }
4107
+ if (field.type === "emergencyContact") {
4108
+ const v = asEmergency(value, defaultPhoneCountry);
4109
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4110
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mb-3 text-sm font-ui font-medium text-foreground", children: [
4111
+ field.label,
4112
+ field.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4113
+ ] }),
4114
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
4115
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
3612
4116
  /* @__PURE__ */ jsxRuntime.jsx(
3613
- DatePickerField,
4117
+ FloatingInput,
3614
4118
  {
3615
- label: "Travel date",
3616
- required: true,
3617
- value: values.travelDate,
3618
- onChange: (d) => set("travelDate", d),
3619
- placeholder: "Pick a date"
4119
+ label: labels.emergencyContactFirstName,
4120
+ required: field.required,
4121
+ value: v.contactName.firstName,
4122
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, v), {
4123
+ contactName: __spreadProps(__spreadValues({}, v.contactName), {
4124
+ firstName: e.target.value
4125
+ })
4126
+ }))
3620
4127
  }
3621
4128
  ),
3622
4129
  /* @__PURE__ */ jsxRuntime.jsx(
3623
4130
  FloatingInput,
3624
4131
  {
3625
- label: "Budget (per person)",
3626
- required: true,
3627
- type: "number",
3628
- min: 0,
3629
- value: values.budget,
3630
- onChange: (e) => set("budget", e.target.value)
4132
+ label: labels.emergencyContactLastName,
4133
+ required: field.required,
4134
+ value: v.contactName.lastName,
4135
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, v), {
4136
+ contactName: __spreadProps(__spreadValues({}, v.contactName), {
4137
+ lastName: e.target.value
4138
+ })
4139
+ }))
3631
4140
  }
3632
4141
  )
3633
- ] }) }),
3634
- /* @__PURE__ */ jsxRuntime.jsx(FormSection, { title: "Tell us about your trip", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3635
- /* @__PURE__ */ jsxRuntime.jsx(
3636
- "textarea",
3637
- {
3638
- id: "project",
3639
- placeholder: " ",
3640
- rows: 5,
3641
- value: values.project,
3642
- onChange: (e) => set("project", e.target.value),
3643
- className: cn(
3644
- "peer block w-full resize-none rounded-lg border border-border bg-background",
3645
- "px-3 pt-6 pb-3 text-base text-foreground font-ui",
3646
- "transition-colors placeholder-transparent",
3647
- "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"
3648
- )
3649
- }
3650
- ),
3651
- /* @__PURE__ */ jsxRuntime.jsxs(
4142
+ ] }),
4143
+ /* @__PURE__ */ jsxRuntime.jsx(
4144
+ PhoneInput,
4145
+ {
4146
+ id: `${fieldId}-phone`,
4147
+ label: labels.emergencyContactPhoneLabel,
4148
+ required: field.required,
4149
+ value: v.phone,
4150
+ onChange: (phone) => onChange(__spreadProps(__spreadValues({}, v), { phone }))
4151
+ }
4152
+ )
4153
+ ] })
4154
+ ] });
4155
+ }
4156
+ if (field.type === "textarea") {
4157
+ return /* @__PURE__ */ jsxRuntime.jsx(
4158
+ FloatingTextarea,
4159
+ {
4160
+ id: fieldId,
4161
+ label: field.label,
4162
+ required: field.required,
4163
+ optionalHint: !field.required ? labels.optionalLabel : void 0,
4164
+ value: typeof value === "string" ? value : "",
4165
+ onChange
4166
+ }
4167
+ );
4168
+ }
4169
+ if (field.type === "select") {
4170
+ const options = (_a = field.options) != null ? _a : [];
4171
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4172
+ FloatingSelect,
4173
+ {
4174
+ label: field.label,
4175
+ required: field.required,
4176
+ value: typeof value === "string" ? value : "",
4177
+ onChange: (e) => onChange(e.target.value),
4178
+ children: [
4179
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, hidden: true }),
4180
+ options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label }, opt.value))
4181
+ ]
4182
+ }
4183
+ );
4184
+ }
4185
+ if (field.type === "radio") {
4186
+ const options = (_b = field.options) != null ? _b : [];
4187
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4188
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mb-3 text-sm font-ui font-medium text-foreground", children: [
4189
+ field.label,
4190
+ field.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4191
+ ] }),
4192
+ /* @__PURE__ */ jsxRuntime.jsx(
4193
+ "div",
4194
+ {
4195
+ role: "radiogroup",
4196
+ "aria-label": field.label,
4197
+ className: "flex flex-wrap items-center gap-x-6 gap-y-3",
4198
+ children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
3652
4199
  "label",
3653
4200
  {
3654
- htmlFor: "project",
3655
- className: cn(
3656
- "pointer-events-none absolute left-3 top-4",
3657
- "text-base text-muted-foreground font-ui transition-all duration-150",
3658
- "peer-focus:top-2 peer-focus:text-xs peer-focus:text-primary",
3659
- "peer-not-placeholder-shown:top-2 peer-not-placeholder-shown:text-xs peer-not-placeholder-shown:text-muted-foreground"
3660
- ),
4201
+ className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-foreground",
3661
4202
  children: [
3662
- "Your trip in a few words",
3663
- " ",
3664
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
4203
+ /* @__PURE__ */ jsxRuntime.jsx(
4204
+ "input",
4205
+ {
4206
+ type: "radio",
4207
+ name: field.id,
4208
+ value: opt.value,
4209
+ checked: value === opt.value,
4210
+ required: field.required,
4211
+ onChange: () => onChange(opt.value),
4212
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4213
+ }
4214
+ ),
4215
+ opt.label
3665
4216
  ]
3666
- }
3667
- )
3668
- ] }) }),
3669
- /* @__PURE__ */ jsxRuntime.jsxs(FormSection, { title: "Contact details", children: [
3670
- /* @__PURE__ */ jsxRuntime.jsx(
3671
- "div",
3672
- {
3673
- role: "radiogroup",
3674
- "aria-label": "Title",
3675
- className: "flex flex-wrap items-center gap-x-6 gap-y-3",
3676
- children: ["ms", "mr"].map((c) => /* @__PURE__ */ jsxRuntime.jsxs(
3677
- "label",
3678
- {
3679
- className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-foreground",
3680
- children: [
3681
- /* @__PURE__ */ jsxRuntime.jsx(
3682
- "input",
3683
- {
3684
- type: "radio",
3685
- name: "civility",
3686
- value: c,
3687
- checked: values.civility === c,
3688
- onChange: () => set("civility", c),
3689
- className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
3690
- }
3691
- ),
3692
- c === "ms" ? "Ms." : "Mr."
3693
- ]
3694
- },
3695
- c
3696
- ))
3697
- }
3698
- ),
3699
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 min-w-0", children: [
3700
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3701
- FloatingInput,
4217
+ },
4218
+ opt.value
4219
+ ))
4220
+ }
4221
+ )
4222
+ ] });
4223
+ }
4224
+ if (field.type === "checkbox") {
4225
+ const options = (_c = field.options) != null ? _c : [];
4226
+ if (options.length === 0) {
4227
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-foreground", children: [
4228
+ /* @__PURE__ */ jsxRuntime.jsx(
4229
+ "input",
4230
+ {
4231
+ type: "checkbox",
4232
+ checked: value === true,
4233
+ onChange: (e) => onChange(e.target.checked),
4234
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4235
+ }
4236
+ ),
4237
+ field.label
4238
+ ] });
4239
+ }
4240
+ const selected = Array.isArray(value) ? value : [];
4241
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4242
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mb-3 text-sm font-ui font-medium text-foreground", children: [
4243
+ field.label,
4244
+ field.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary ml-0.5", children: "*" })
4245
+ ] }),
4246
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: options.map((opt) => {
4247
+ const checked = selected.includes(opt.value);
4248
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4249
+ "label",
4250
+ {
4251
+ className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-foreground",
4252
+ children: [
4253
+ /* @__PURE__ */ jsxRuntime.jsx(
4254
+ "input",
4255
+ {
4256
+ type: "checkbox",
4257
+ checked,
4258
+ onChange: (e) => onChange(
4259
+ e.target.checked ? [...selected, opt.value] : selected.filter((x) => x !== opt.value)
4260
+ ),
4261
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4262
+ }
4263
+ ),
4264
+ opt.label
4265
+ ]
4266
+ },
4267
+ opt.value
4268
+ );
4269
+ }) })
4270
+ ] });
4271
+ }
4272
+ if (field.type === "nationality") {
4273
+ return /* @__PURE__ */ jsxRuntime.jsx(
4274
+ CountrySearchField,
4275
+ {
4276
+ label: field.label,
4277
+ required: field.required,
4278
+ value: typeof value === "string" ? value : "",
4279
+ onChange: (code) => onChange(code)
4280
+ }
4281
+ );
4282
+ }
4283
+ if (field.type === "date") {
4284
+ return /* @__PURE__ */ jsxRuntime.jsx(
4285
+ DatePickerField,
4286
+ {
4287
+ label: field.label,
4288
+ required: field.required,
4289
+ value: asDate(value),
4290
+ onChange: (d) => onChange(d)
4291
+ }
4292
+ );
4293
+ }
4294
+ if (field.type === "birthDate") {
4295
+ return /* @__PURE__ */ jsxRuntime.jsx(
4296
+ BirthDateField,
4297
+ {
4298
+ label: field.label,
4299
+ required: field.required,
4300
+ value: asDate(value),
4301
+ onChange: (d) => onChange(d)
4302
+ }
4303
+ );
4304
+ }
4305
+ if (field.type === "number") {
4306
+ return /* @__PURE__ */ jsxRuntime.jsx(
4307
+ FloatingInput,
4308
+ {
4309
+ label: field.label,
4310
+ required: field.required,
4311
+ type: "number",
4312
+ value: value == null ? "" : String(value),
4313
+ onChange: (e) => onChange(e.target.value)
4314
+ }
4315
+ );
4316
+ }
4317
+ const htmlType = field.label.toLowerCase().includes("mail") ? "email" : "text";
4318
+ return /* @__PURE__ */ jsxRuntime.jsx(
4319
+ FloatingInput,
4320
+ {
4321
+ label: field.label,
4322
+ required: field.required,
4323
+ type: htmlType,
4324
+ value: typeof value === "string" ? value : "",
4325
+ onChange: (e) => onChange(e.target.value)
4326
+ }
4327
+ );
4328
+ }
4329
+ function RegistrationForm({
4330
+ logo = "/logo-planetaexo.png",
4331
+ logoAlt = "Planeta EXO",
4332
+ heroImage,
4333
+ heroImageAlt = "",
4334
+ title,
4335
+ subtitle,
4336
+ adventure,
4337
+ booking,
4338
+ traveller,
4339
+ fields,
4340
+ values,
4341
+ defaultValues,
4342
+ onChange,
4343
+ onSubmit,
4344
+ terms,
4345
+ includeTerms = false,
4346
+ loading = false,
4347
+ error,
4348
+ defaultPhoneCountry = "BR",
4349
+ dateFormatter,
4350
+ labels,
4351
+ className
4352
+ }) {
4353
+ var _a;
4354
+ const L = React21__namespace.useMemo(
4355
+ () => __spreadValues(__spreadValues({}, DEFAULT_LABELS3), labels != null ? labels : {}),
4356
+ [labels]
4357
+ );
4358
+ const sortedFields = React21__namespace.useMemo(
4359
+ () => [...fields].sort((a, b) => {
4360
+ var _a2, _b;
4361
+ return ((_a2 = a.order) != null ? _a2 : 0) - ((_b = b.order) != null ? _b : 0);
4362
+ }),
4363
+ [fields]
4364
+ );
4365
+ const isControlled = values !== void 0;
4366
+ const [internal, setInternal] = React21__namespace.useState(
4367
+ () => initializeValues(
4368
+ sortedFields,
4369
+ defaultValues != null ? defaultValues : {},
4370
+ defaultPhoneCountry,
4371
+ includeTerms
4372
+ )
4373
+ );
4374
+ React21__namespace.useEffect(() => {
4375
+ if (isControlled) return;
4376
+ setInternal((prev) => {
4377
+ const next = initializeValues(
4378
+ sortedFields,
4379
+ defaultValues != null ? defaultValues : {},
4380
+ defaultPhoneCountry,
4381
+ includeTerms
4382
+ );
4383
+ for (const k of Object.keys(prev)) {
4384
+ if (Object.prototype.hasOwnProperty.call(next, k)) next[k] = prev[k];
4385
+ }
4386
+ return next;
4387
+ });
4388
+ }, [sortedFields.length, includeTerms]);
4389
+ const current = isControlled ? values : internal;
4390
+ const setField = (id, value) => {
4391
+ const next = __spreadProps(__spreadValues({}, current), { [id]: value });
4392
+ if (!isControlled) setInternal(next);
4393
+ onChange == null ? void 0 : onChange(next);
4394
+ };
4395
+ const handleSubmit = (e) => {
4396
+ e.preventDefault();
4397
+ onSubmit == null ? void 0 : onSubmit(current);
4398
+ };
4399
+ const termsAccepted = current[TERMS_ACCEPT_KEY] === true;
4400
+ const termsEnabled = includeTerms && !!terms;
4401
+ const acceptControl = (_a = terms == null ? void 0 : terms.acceptControl) != null ? _a : "checkbox";
4402
+ const dateRange = formatDateRange(adventure, dateFormatter);
4403
+ const hasTripInfo = !!adventure || !!booking || !!traveller;
4404
+ return /* @__PURE__ */ jsxRuntime.jsxs(
4405
+ "form",
4406
+ {
4407
+ onSubmit: handleSubmit,
4408
+ noValidate: true,
4409
+ className: cn("flex flex-col gap-10", className),
4410
+ children: [
4411
+ heroImage ? (
4412
+ /* ── Hero image (full-width) with centered white logo ─────────── */
4413
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
4414
+ /* @__PURE__ */ jsxRuntime.jsx(
4415
+ "img",
3702
4416
  {
3703
- label: "Last name",
3704
- required: true,
3705
- value: values.lastName,
3706
- onChange: (e) => set("lastName", e.target.value)
4417
+ src: heroImage,
4418
+ alt: heroImageAlt,
4419
+ className: "block h-[190px] w-full object-cover sm:h-[220px]"
3707
4420
  }
3708
- ) }),
3709
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3710
- FloatingInput,
4421
+ ),
4422
+ /* @__PURE__ */ jsxRuntime.jsx(
4423
+ "div",
3711
4424
  {
3712
- label: "First name",
3713
- required: true,
3714
- value: values.firstName,
3715
- onChange: (e) => set("firstName", e.target.value)
4425
+ "aria-hidden": true,
4426
+ className: "absolute inset-0 bg-black/25"
3716
4427
  }
3717
- ) }),
3718
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 sm:col-span-2 lg:col-span-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
3719
- FloatingSelect,
4428
+ ),
4429
+ logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
4430
+ "img",
3720
4431
  {
3721
- label: "Country of residence",
3722
- required: true,
3723
- value: values.country,
3724
- onChange: (e) => set("country", e.target.value),
3725
- children: [
3726
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, hidden: true }),
3727
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "France", children: "France" }),
3728
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Belgium", children: "Belgium" }),
3729
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Switzerland", children: "Switzerland" }),
3730
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Canada", children: "Canada" }),
3731
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Luxembourg", children: "Luxembourg" }),
3732
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "United Kingdom", children: "United Kingdom" }),
3733
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "United States", children: "United States" }),
3734
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "Other", children: "Other" })
3735
- ]
4432
+ src: logo,
4433
+ alt: logoAlt,
4434
+ className: "block h-auto w-[120px] object-contain brightness-0 invert"
3736
4435
  }
3737
4436
  ) })
4437
+ ] })
4438
+ ) : logo && /* eslint-disable-next-line @next/next/no-img-element */
4439
+ /* @__PURE__ */ jsxRuntime.jsx(
4440
+ "img",
4441
+ {
4442
+ src: logo,
4443
+ alt: logoAlt,
4444
+ className: "mx-auto block h-auto w-[150px] object-contain"
4445
+ }
4446
+ ),
4447
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
4448
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
4449
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-sm text-muted-foreground font-ui", children: subtitle != null ? subtitle : L.formSubtitle })
4450
+ ] }),
4451
+ hasTripInfo && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: L.tripInfoSectionTitle, children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-1 gap-x-6 gap-y-3 text-sm font-ui sm:grid-cols-[max-content_1fr]", children: [
4452
+ adventure && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4453
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: L.adventureLabel }),
4454
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium", children: adventure.name })
3738
4455
  ] }),
3739
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
3740
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full min-w-0", children: [
3741
- /* @__PURE__ */ jsxRuntime.jsx(
3742
- PhoneCountrySelect,
3743
- {
3744
- value: values.phoneCountry,
3745
- onChange: (code) => set("phoneCountry", code),
3746
- className: "shrink-0"
3747
- }
3748
- ),
3749
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative min-w-0 flex-1", children: [
3750
- /* @__PURE__ */ jsxRuntime.jsx(
3751
- "input",
3752
- {
3753
- id: "phone",
3754
- type: "tel",
3755
- placeholder: " ",
3756
- value: values.phone,
3757
- onChange: (e) => set("phone", e.target.value),
3758
- className: cn(
3759
- "peer block h-14 w-full rounded-r-lg border border-border bg-background",
3760
- "px-3 pt-5 pb-2 text-base text-foreground font-ui",
3761
- "transition-colors placeholder-transparent",
3762
- "focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"
3763
- )
3764
- }
3765
- ),
3766
- /* @__PURE__ */ jsxRuntime.jsxs(
3767
- "label",
3768
- {
3769
- htmlFor: "phone",
3770
- className: cn(
3771
- "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2",
3772
- "text-base text-muted-foreground font-ui transition-all duration-150",
3773
- "peer-focus:top-3 peer-focus:translate-y-0 peer-focus:text-xs peer-focus:text-primary",
3774
- "peer-not-placeholder-shown:top-3 peer-not-placeholder-shown:translate-y-0 peer-not-placeholder-shown:text-xs peer-not-placeholder-shown:text-muted-foreground"
3775
- ),
3776
- children: [
3777
- "Phone ",
3778
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "*" })
3779
- ]
3780
- }
3781
- )
3782
- ] })
3783
- ] }),
3784
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
3785
- FloatingInput,
4456
+ dateRange && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4457
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
4458
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground", children: dateRange })
4459
+ ] }),
4460
+ (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4461
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: L.partnerLabel }),
4462
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground", children: adventure.partnerName })
4463
+ ] }),
4464
+ booking && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4465
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: L.bookingLabel }),
4466
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-mono tabular-nums", children: booking.id })
4467
+ ] }),
4468
+ traveller && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4469
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: L.travellerLabel }),
4470
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium", children: traveller.fullName })
4471
+ ] })
4472
+ ] }) }),
4473
+ /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: L.detailsSectionTitle, children: sortedFields.map((field) => {
4474
+ var _a2;
4475
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1.5", children: [
4476
+ /* @__PURE__ */ jsxRuntime.jsx(
4477
+ FieldRenderer,
3786
4478
  {
3787
- label: "Email",
4479
+ field,
4480
+ value: current[field.id],
4481
+ onChange: (v) => setField(field.id, v),
4482
+ defaultPhoneCountry,
4483
+ labels: L
4484
+ }
4485
+ ),
4486
+ ((_a2 = field.helpText) == null ? void 0 : _a2.trim()) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground font-ui leading-relaxed", children: field.helpText.trim() })
4487
+ ] }, field.id);
4488
+ }) }),
4489
+ termsEnabled && terms && /* @__PURE__ */ jsxRuntime.jsxs(FormSection2, { title: L.termsSectionTitle, children: [
4490
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-72 overflow-y-auto rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) }),
4491
+ acceptControl === "checkbox" ? /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex cursor-pointer items-start gap-2.5 font-ui text-sm text-foreground", children: [
4492
+ /* @__PURE__ */ jsxRuntime.jsx(
4493
+ "input",
4494
+ {
4495
+ type: "checkbox",
4496
+ checked: termsAccepted,
3788
4497
  required: true,
3789
- type: "email",
3790
- value: values.email,
3791
- onChange: (e) => set("email", e.target.value)
4498
+ onChange: (e) => setField(TERMS_ACCEPT_KEY, e.target.checked),
4499
+ className: "mt-0.5 h-4 w-4 shrink-0 accent-primary cursor-pointer"
3792
4500
  }
3793
- ) })
3794
- ] })
4501
+ ),
4502
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: L.termsAccept })
4503
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
4504
+ "div",
4505
+ {
4506
+ role: "radiogroup",
4507
+ "aria-label": L.termsSectionTitle,
4508
+ className: "flex flex-wrap items-center gap-x-6 gap-y-3",
4509
+ children: [
4510
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-foreground", children: [
4511
+ /* @__PURE__ */ jsxRuntime.jsx(
4512
+ "input",
4513
+ {
4514
+ type: "radio",
4515
+ name: "registration-terms-accept",
4516
+ checked: termsAccepted,
4517
+ required: true,
4518
+ onChange: () => setField(TERMS_ACCEPT_KEY, true),
4519
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4520
+ }
4521
+ ),
4522
+ L.termsAccept
4523
+ ] }),
4524
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex min-h-9 cursor-pointer items-center gap-2.5 font-ui text-sm text-muted-foreground", children: [
4525
+ /* @__PURE__ */ jsxRuntime.jsx(
4526
+ "input",
4527
+ {
4528
+ type: "radio",
4529
+ name: "registration-terms-accept",
4530
+ checked: current[TERMS_ACCEPT_KEY] === false,
4531
+ onChange: () => setField(TERMS_ACCEPT_KEY, false),
4532
+ className: "h-4 w-4 shrink-0 accent-primary cursor-pointer"
4533
+ }
4534
+ ),
4535
+ L.termsDecline
4536
+ ] })
4537
+ ]
4538
+ }
4539
+ )
3795
4540
  ] }),
4541
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive font-ui", children: error }),
3796
4542
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
3797
4543
  "button",
3798
4544
  {
@@ -3806,35 +4552,121 @@ function BookingForm({
3806
4552
  "disabled:pointer-events-none disabled:opacity-60"
3807
4553
  ),
3808
4554
  children: loading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3809
- /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
3810
- /* @__PURE__ */ jsxRuntime.jsx(
3811
- "circle",
3812
- {
3813
- className: "opacity-25",
3814
- cx: "12",
3815
- cy: "12",
3816
- r: "10",
3817
- stroke: "currentColor",
3818
- strokeWidth: "4"
3819
- }
3820
- ),
3821
- /* @__PURE__ */ jsxRuntime.jsx(
3822
- "path",
3823
- {
3824
- className: "opacity-75",
3825
- fill: "currentColor",
3826
- d: "M4 12a8 8 0 018-8v4l3-3-3-3v4a8 8 0 00-8 8h4z"
3827
- }
3828
- )
3829
- ] }),
3830
- "Sending\u2026"
3831
- ] }) : submitLabel
4555
+ /* @__PURE__ */ jsxRuntime.jsxs(
4556
+ "svg",
4557
+ {
4558
+ className: "h-4 w-4 animate-spin",
4559
+ viewBox: "0 0 24 24",
4560
+ fill: "none",
4561
+ children: [
4562
+ /* @__PURE__ */ jsxRuntime.jsx(
4563
+ "circle",
4564
+ {
4565
+ className: "opacity-25",
4566
+ cx: "12",
4567
+ cy: "12",
4568
+ r: "10",
4569
+ stroke: "currentColor",
4570
+ strokeWidth: "4"
4571
+ }
4572
+ ),
4573
+ /* @__PURE__ */ jsxRuntime.jsx(
4574
+ "path",
4575
+ {
4576
+ className: "opacity-75",
4577
+ fill: "currentColor",
4578
+ d: "M4 12a8 8 0 018-8v4l3-3-3-3v4a8 8 0 00-8 8h4z"
4579
+ }
4580
+ )
4581
+ ]
4582
+ }
4583
+ ),
4584
+ L.submitting
4585
+ ] }) : L.submitButton
3832
4586
  }
3833
4587
  ) })
3834
4588
  ]
3835
4589
  }
3836
4590
  );
3837
4591
  }
4592
+ function phoneCountryDial(code) {
4593
+ var _a, _b;
4594
+ return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
4595
+ }
4596
+ function defaultFormatAnswer(field, value, fmtDate) {
4597
+ var _a, _b, _c, _d, _e, _f;
4598
+ if (value == null || value === "") return "\u2014";
4599
+ if (value instanceof Date) return fmtDate(value);
4600
+ if (Array.isArray(value)) {
4601
+ if (field.type === "checkbox" && field.options) {
4602
+ return field.options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ") || "\u2014";
4603
+ }
4604
+ return value.filter(Boolean).join(", ") || "\u2014";
4605
+ }
4606
+ if (typeof value === "boolean") return value ? "Yes" : "No";
4607
+ if (typeof value === "object") {
4608
+ if ("contactName" in value) {
4609
+ const ec = value;
4610
+ const name = [ec.contactName.firstName, ec.contactName.lastName].filter(Boolean).join(" ");
4611
+ const phone = [phoneCountryDial(ec.phone.country), ec.phone.nationalNumber].filter(Boolean).join(" ");
4612
+ return [name, phone].filter(Boolean).join(" \xB7 ") || "\u2014";
4613
+ }
4614
+ if ("firstName" in value || "lastName" in value) {
4615
+ const n = value;
4616
+ return [n.firstName, n.lastName].filter(Boolean).join(" ") || "\u2014";
4617
+ }
4618
+ if ("country" in value && "nationalNumber" in value) {
4619
+ const p = value;
4620
+ return [phoneCountryDial(p.country), p.nationalNumber].filter(Boolean).join(" ") || "\u2014";
4621
+ }
4622
+ }
4623
+ if (field.type === "nationality" && typeof value === "string") {
4624
+ return (_b = (_a = COUNTRIES.find((c) => c.code === value)) == null ? void 0 : _a.name) != null ? _b : value;
4625
+ }
4626
+ if (field.type === "select" && field.options) {
4627
+ return (_d = (_c = field.options.find((o) => o.value === value)) == null ? void 0 : _c.label) != null ? _d : String(value);
4628
+ }
4629
+ if (field.type === "radio" && field.options) {
4630
+ return (_f = (_e = field.options.find((o) => o.value === value)) == null ? void 0 : _e.label) != null ? _f : String(value);
4631
+ }
4632
+ if (field.type === "date" && typeof value === "string") return fmtDate(value);
4633
+ return String(value);
4634
+ }
4635
+ function isoOrDateToString(v) {
4636
+ if (!v) return "\u2014";
4637
+ const d = v instanceof Date ? v : new Date(v);
4638
+ if (Number.isNaN(d.getTime())) return typeof v === "string" ? v : "\u2014";
4639
+ return d.toISOString().slice(0, 10);
4640
+ }
4641
+ function RegistrationSuccessCard({
4642
+ title = "Thanks \u2014 your answers have been received.",
4643
+ message = "We'll get in touch if anything else is needed.",
4644
+ answersTitle = "Your submitted answers",
4645
+ fields,
4646
+ answers,
4647
+ dateFormatter = isoOrDateToString,
4648
+ formatAnswer,
4649
+ className
4650
+ }) {
4651
+ const sorted = [...fields].sort((a, b) => {
4652
+ var _a, _b;
4653
+ return ((_a = a.order) != null ? _a : 0) - ((_b = b.order) != null ? _b : 0);
4654
+ }).filter((f) => Object.prototype.hasOwnProperty.call(answers, f.id));
4655
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-10", className), children: [
4656
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [
4657
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { size: 28 }) }),
4658
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-black uppercase tracking-wide text-foreground font-heading leading-tight", children: title }),
4659
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
4660
+ ] }),
4661
+ sorted.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: answersTitle, children: /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid grid-cols-1 gap-x-6 gap-y-3 text-sm font-ui sm:grid-cols-[max-content_1fr]", children: sorted.map((f) => /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
4662
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
4663
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
4664
+ f,
4665
+ answers[f.id]
4666
+ ) })
4667
+ ] }, f.id)) }) })
4668
+ ] });
4669
+ }
3838
4670
  function Checkbox(_a) {
3839
4671
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
3840
4672
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -3860,7 +4692,7 @@ function Checkbox(_a) {
3860
4692
  })
3861
4693
  );
3862
4694
  }
3863
- var AccordionVariantContext = React19__namespace.createContext("default");
4695
+ var AccordionVariantContext = React21__namespace.createContext("default");
3864
4696
  function Accordion(_a) {
3865
4697
  var _b = _a, { className, variant = "default" } = _b, props = __objRest(_b, ["className", "variant"]);
3866
4698
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -3878,7 +4710,7 @@ function Accordion(_a) {
3878
4710
  }
3879
4711
  function AccordionItem(_a) {
3880
4712
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
3881
- const variant = React19__namespace.useContext(AccordionVariantContext);
4713
+ const variant = React21__namespace.useContext(AccordionVariantContext);
3882
4714
  return /* @__PURE__ */ jsxRuntime.jsx(
3883
4715
  accordion.Accordion.Item,
3884
4716
  __spreadValues({
@@ -3899,7 +4731,7 @@ function AccordionTrigger(_a) {
3899
4731
  "className",
3900
4732
  "children"
3901
4733
  ]);
3902
- const variant = React19__namespace.useContext(AccordionVariantContext);
4734
+ const variant = React21__namespace.useContext(AccordionVariantContext);
3903
4735
  return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
3904
4736
  accordion.Accordion.Trigger,
3905
4737
  __spreadProps(__spreadValues({
@@ -3953,7 +4785,7 @@ function AccordionContent(_a) {
3953
4785
  "className",
3954
4786
  "children"
3955
4787
  ]);
3956
- const variant = React19__namespace.useContext(AccordionVariantContext);
4788
+ const variant = React21__namespace.useContext(AccordionVariantContext);
3957
4789
  return /* @__PURE__ */ jsxRuntime.jsx(
3958
4790
  accordion.Accordion.Panel,
3959
4791
  __spreadProps(__spreadValues({
@@ -3985,7 +4817,7 @@ function FilterPanel({
3985
4817
  title = "Filters",
3986
4818
  className
3987
4819
  }) {
3988
- const [internalValue, setInternalValue] = React19__namespace.useState(
4820
+ const [internalValue, setInternalValue] = React21__namespace.useState(
3989
4821
  () => Object.fromEntries(groups.map((g) => [g.id, []]))
3990
4822
  );
3991
4823
  const selected = value != null ? value : internalValue;
@@ -4147,11 +4979,11 @@ function ItineraryModal({
4147
4979
  onNext
4148
4980
  }) {
4149
4981
  var _a, _b, _c;
4150
- const [imgIndex, setImgIndex] = React19__namespace.useState(0);
4982
+ const [imgIndex, setImgIndex] = React21__namespace.useState(0);
4151
4983
  const images = stop ? [stop.coverImage, ...(_a = stop.images) != null ? _a : []] : [];
4152
4984
  const isFirst = (stop == null ? void 0 : stop.dayNumber) === ((_b = allStops[0]) == null ? void 0 : _b.dayNumber);
4153
4985
  const isLast = (stop == null ? void 0 : stop.dayNumber) === ((_c = allStops[allStops.length - 1]) == null ? void 0 : _c.dayNumber);
4154
- React19__namespace.useEffect(() => {
4986
+ React21__namespace.useEffect(() => {
4155
4987
  setImgIndex(0);
4156
4988
  }, [stop == null ? void 0 : stop.dayNumber]);
4157
4989
  if (!stop) return null;
@@ -4278,8 +5110,8 @@ function ItineraryModal({
4278
5110
  ) });
4279
5111
  }
4280
5112
  function Itinerary({ title, subtitle, stops, className }) {
4281
- const [activeIndex, setActiveIndex] = React19__namespace.useState(null);
4282
- const scrollRef = React19__namespace.useRef(null);
5113
+ const [activeIndex, setActiveIndex] = React21__namespace.useState(null);
5114
+ const scrollRef = React21__namespace.useRef(null);
4283
5115
  const activeStop = activeIndex !== null ? stops[activeIndex] : null;
4284
5116
  const scrollBy = (dir) => {
4285
5117
  if (!scrollRef.current) return;
@@ -4365,8 +5197,8 @@ function MenuTrip({
4365
5197
  bold = true,
4366
5198
  className
4367
5199
  }) {
4368
- const scrollRef = React19__namespace.useRef(null);
4369
- React19__namespace.useEffect(() => {
5200
+ const scrollRef = React21__namespace.useRef(null);
5201
+ React21__namespace.useEffect(() => {
4370
5202
  if (!scrollRef.current || !activeSection) return;
4371
5203
  const container = scrollRef.current;
4372
5204
  const btn = container.querySelector(
@@ -4512,18 +5344,18 @@ function Lightbox({
4512
5344
  onClose
4513
5345
  }) {
4514
5346
  var _a;
4515
- const [index, setIndex] = React19__namespace.useState(initialIndex);
5347
+ const [index, setIndex] = React21__namespace.useState(initialIndex);
4516
5348
  const total = photos.length;
4517
5349
  const photo = photos[index];
4518
- const prev = React19__namespace.useCallback(
5350
+ const prev = React21__namespace.useCallback(
4519
5351
  () => setIndex((i) => (i - 1 + total) % total),
4520
5352
  [total]
4521
5353
  );
4522
- const next = React19__namespace.useCallback(
5354
+ const next = React21__namespace.useCallback(
4523
5355
  () => setIndex((i) => (i + 1) % total),
4524
5356
  [total]
4525
5357
  );
4526
- React19__namespace.useEffect(() => {
5358
+ React21__namespace.useEffect(() => {
4527
5359
  const onKey = (e) => {
4528
5360
  if (e.key === "Escape") onClose();
4529
5361
  if (e.key === "ArrowLeft") prev();
@@ -4717,7 +5549,7 @@ function GridGallery({
4717
5549
  initialVisible,
4718
5550
  onOpen
4719
5551
  }) {
4720
- const [expanded, setExpanded] = React19__namespace.useState(false);
5552
+ const [expanded, setExpanded] = React21__namespace.useState(false);
4721
5553
  const cols = gridCols(photos.length);
4722
5554
  const hasMore = photos.length > initialVisible;
4723
5555
  const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
@@ -4747,7 +5579,7 @@ function MasonryGallery({
4747
5579
  initialVisible,
4748
5580
  onOpen
4749
5581
  }) {
4750
- const [expanded, setExpanded] = React19__namespace.useState(false);
5582
+ const [expanded, setExpanded] = React21__namespace.useState(false);
4751
5583
  const hasMore = photos.length > initialVisible;
4752
5584
  const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
4753
5585
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -4820,7 +5652,7 @@ function FeaturedGallery({
4820
5652
  photos,
4821
5653
  onOpen
4822
5654
  }) {
4823
- const [expanded, setExpanded] = React19__namespace.useState(false);
5655
+ const [expanded, setExpanded] = React21__namespace.useState(false);
4824
5656
  const featured = photos.slice(0, 3);
4825
5657
  const extra = photos.slice(3);
4826
5658
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -4897,8 +5729,8 @@ function PhotoGallery({
4897
5729
  onPhotoClick,
4898
5730
  className
4899
5731
  }) {
4900
- const [lightboxIndex, setLightboxIndex] = React19__namespace.useState(null);
4901
- const normalised = React19__namespace.useMemo(() => photos.map(normalise), [photos]);
5732
+ const [lightboxIndex, setLightboxIndex] = React21__namespace.useState(null);
5733
+ const normalised = React21__namespace.useMemo(() => photos.map(normalise), [photos]);
4902
5734
  const handleOpen = (index) => {
4903
5735
  setLightboxIndex(index);
4904
5736
  onPhotoClick == null ? void 0 : onPhotoClick(normalised[index].src, index);
@@ -4987,7 +5819,7 @@ function PricingTrip({
4987
5819
  variant = "card",
4988
5820
  className
4989
5821
  }) {
4990
- const [showPricing, setShowPricing] = React19__namespace.useState(false);
5822
+ const [showPricing, setShowPricing] = React21__namespace.useState(false);
4991
5823
  if (variant === "compact") {
4992
5824
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-3", className), children: [
4993
5825
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -5310,14 +6142,14 @@ function SiteHeader({
5310
6142
  className
5311
6143
  }) {
5312
6144
  const t = VARIANT[variant];
5313
- const [openMenu, setOpenMenu] = React19__namespace.useState(null);
5314
- const [langOpen, setLangOpen] = React19__namespace.useState(false);
5315
- const [mobileOpen, setMobileOpen] = React19__namespace.useState(false);
5316
- const [openMobileSection, setOpenMobileSection] = React19__namespace.useState(null);
5317
- const [activeLang, setActiveLang] = React19__namespace.useState(currentLanguage);
6145
+ const [openMenu, setOpenMenu] = React21__namespace.useState(null);
6146
+ const [langOpen, setLangOpen] = React21__namespace.useState(false);
6147
+ const [mobileOpen, setMobileOpen] = React21__namespace.useState(false);
6148
+ const [openMobileSection, setOpenMobileSection] = React21__namespace.useState(null);
6149
+ const [activeLang, setActiveLang] = React21__namespace.useState(currentLanguage);
5318
6150
  const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
5319
- const menuCloseTimer = React19__namespace.useRef(void 0);
5320
- const langCloseTimer = React19__namespace.useRef(void 0);
6151
+ const menuCloseTimer = React21__namespace.useRef(void 0);
6152
+ const langCloseTimer = React21__namespace.useRef(void 0);
5321
6153
  const handleMenuEnter = (label) => {
5322
6154
  clearTimeout(menuCloseTimer.current);
5323
6155
  setOpenMenu(label);
@@ -5338,7 +6170,7 @@ function SiteHeader({
5338
6170
  setOpenMenu(null);
5339
6171
  setLangOpen(false);
5340
6172
  };
5341
- React19__namespace.useEffect(() => () => {
6173
+ React21__namespace.useEffect(() => () => {
5342
6174
  clearTimeout(menuCloseTimer.current);
5343
6175
  clearTimeout(langCloseTimer.current);
5344
6176
  }, []);
@@ -5603,7 +6435,7 @@ function SiteHeader({
5603
6435
  ), children: [
5604
6436
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
5605
6437
  const isActive = lang.code === activeLang;
5606
- return /* @__PURE__ */ jsxRuntime.jsxs(React19__namespace.Fragment, { children: [
6438
+ return /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
5607
6439
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
5608
6440
  "text-xs select-none",
5609
6441
  variant === "white" ? "text-border" : "text-white/15"
@@ -5665,8 +6497,8 @@ function SiteHeader({
5665
6497
  );
5666
6498
  }
5667
6499
  function ThemeToggle({ className }) {
5668
- const [dark, setDark] = React19__namespace.useState(false);
5669
- React19__namespace.useEffect(() => {
6500
+ const [dark, setDark] = React21__namespace.useState(false);
6501
+ React21__namespace.useEffect(() => {
5670
6502
  const saved = localStorage.getItem("theme");
5671
6503
  const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
5672
6504
  const isDark = saved === "dark" || !saved && prefersDark;
@@ -5695,7 +6527,7 @@ function ThemeToggle({ className }) {
5695
6527
  }
5696
6528
  );
5697
6529
  }
5698
- function CalendarIcon5() {
6530
+ function CalendarIcon6() {
5699
6531
  return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
5700
6532
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
5701
6533
  /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
@@ -5738,7 +6570,7 @@ var sizeConfig = {
5738
6570
  var statusConfig = {
5739
6571
  "sold-out": {
5740
6572
  label: "All seats taken",
5741
- icon: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon5, {})
6573
+ icon: /* @__PURE__ */ jsxRuntime.jsx(CalendarIcon6, {})
5742
6574
  },
5743
6575
  trending: {
5744
6576
  label: "Trending",
@@ -5817,7 +6649,7 @@ function TripCard({
5817
6649
  );
5818
6650
  }
5819
6651
  function useHlsVideo(videoRef, src) {
5820
- React19__namespace.useEffect(() => {
6652
+ React21__namespace.useEffect(() => {
5821
6653
  if (!src || !videoRef.current) return;
5822
6654
  const video = videoRef.current;
5823
6655
  if (!src.includes(".m3u8")) return;
@@ -5859,11 +6691,11 @@ function TripHeader({
5859
6691
  className
5860
6692
  }) {
5861
6693
  var _a;
5862
- const [heroIndex, setHeroIndex] = React19__namespace.useState(0);
5863
- const [videoReady, setVideoReady] = React19__namespace.useState(false);
5864
- const videoRef = React19__namespace.useRef(null);
6694
+ const [heroIndex, setHeroIndex] = React21__namespace.useState(0);
6695
+ const [videoReady, setVideoReady] = React21__namespace.useState(false);
6696
+ const videoRef = React21__namespace.useRef(null);
5865
6697
  const isHls = !!(videoUrl == null ? void 0 : videoUrl.includes(".m3u8"));
5866
- const validImages = React19__namespace.useMemo(
6698
+ const validImages = React21__namespace.useMemo(
5867
6699
  () => images.map((u) => u == null ? void 0 : u.trim()).filter(Boolean),
5868
6700
  [images]
5869
6701
  );
@@ -5878,7 +6710,7 @@ function TripHeader({
5878
6710
  const nights = duration ? (_a = duration.nights) != null ? _a : Math.max(duration.days - 1, 1) : null;
5879
6711
  const hasMeta = !!(destination || duration);
5880
6712
  useHlsVideo(videoRef, isHls ? videoUrl : void 0);
5881
- React19__namespace.useEffect(() => {
6713
+ React21__namespace.useEffect(() => {
5882
6714
  if (!videoUrl) return;
5883
6715
  const el = videoRef.current;
5884
6716
  if (!el) return;
@@ -6020,7 +6852,7 @@ function TripHeader({
6020
6852
  siteHeader ? "-mt-44" : "-mt-36"
6021
6853
  ),
6022
6854
  children: [
6023
- breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React19__namespace.Fragment, { children: [
6855
+ breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React21__namespace.Fragment, { children: [
6024
6856
  i > 0 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
6025
6857
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-white/70 font-ui hover:text-white/90 cursor-default", children: crumb.label })
6026
6858
  ] }, i)) }),
@@ -6120,19 +6952,19 @@ function TripPage({
6120
6952
  features,
6121
6953
  className
6122
6954
  }) {
6123
- const [activeSection, setActiveSection] = React19__namespace.useState("");
6124
- const [navFloating, setNavFloating] = React19__namespace.useState(false);
6125
- const [navHidden, setNavHidden] = React19__namespace.useState(false);
6126
- const [isFloating, setIsFloating] = React19__namespace.useState(false);
6127
- const [sidebarPos, setSidebarPos] = React19__namespace.useState(null);
6128
- const [pricingBarVisible, setPricingBarVisible] = React19__namespace.useState(false);
6129
- const navRef = React19__namespace.useRef(null);
6130
- const navSentinelRef = React19__namespace.useRef(null);
6131
- const sentinelRef = React19__namespace.useRef(null);
6132
- const sidebarPlaceholderRef = React19__namespace.useRef(null);
6133
- const pricingBarRef = React19__namespace.useRef(null);
6134
- const galleryRef = React19__namespace.useRef(null);
6135
- const sections = React19__namespace.useMemo(
6955
+ const [activeSection, setActiveSection] = React21__namespace.useState("");
6956
+ const [navFloating, setNavFloating] = React21__namespace.useState(false);
6957
+ const [navHidden, setNavHidden] = React21__namespace.useState(false);
6958
+ const [isFloating, setIsFloating] = React21__namespace.useState(false);
6959
+ const [sidebarPos, setSidebarPos] = React21__namespace.useState(null);
6960
+ const [pricingBarVisible, setPricingBarVisible] = React21__namespace.useState(false);
6961
+ const navRef = React21__namespace.useRef(null);
6962
+ const navSentinelRef = React21__namespace.useRef(null);
6963
+ const sentinelRef = React21__namespace.useRef(null);
6964
+ const sidebarPlaceholderRef = React21__namespace.useRef(null);
6965
+ const pricingBarRef = React21__namespace.useRef(null);
6966
+ const galleryRef = React21__namespace.useRef(null);
6967
+ const sections = React21__namespace.useMemo(
6136
6968
  () => [
6137
6969
  { id: "key-info", label: "Key info", show: !!(infoGroups == null ? void 0 : infoGroups.length) },
6138
6970
  { id: "overview", label: "Overview", show: !!overview },
@@ -6147,7 +6979,7 @@ function TripPage({
6147
6979
  // eslint-disable-next-line react-hooks/exhaustive-deps
6148
6980
  []
6149
6981
  );
6150
- React19__namespace.useEffect(() => {
6982
+ React21__namespace.useEffect(() => {
6151
6983
  const sentinel = navSentinelRef.current;
6152
6984
  if (!sentinel) return;
6153
6985
  const update = () => setNavFloating(sentinel.getBoundingClientRect().top < 1);
@@ -6155,7 +6987,7 @@ function TripPage({
6155
6987
  update();
6156
6988
  return () => document.removeEventListener("scroll", update, { capture: true });
6157
6989
  }, []);
6158
- React19__namespace.useEffect(() => {
6990
+ React21__namespace.useEffect(() => {
6159
6991
  const sentinel = sentinelRef.current;
6160
6992
  if (!sentinel) return;
6161
6993
  const update = () => setIsFloating(sentinel.getBoundingClientRect().top < 1);
@@ -6163,7 +6995,7 @@ function TripPage({
6163
6995
  update();
6164
6996
  return () => document.removeEventListener("scroll", update, { capture: true });
6165
6997
  }, []);
6166
- React19__namespace.useEffect(() => {
6998
+ React21__namespace.useEffect(() => {
6167
6999
  const measure = () => {
6168
7000
  if (!sidebarPlaceholderRef.current) return;
6169
7001
  const rect = sidebarPlaceholderRef.current.getBoundingClientRect();
@@ -6173,7 +7005,7 @@ function TripPage({
6173
7005
  window.addEventListener("resize", measure);
6174
7006
  return () => window.removeEventListener("resize", measure);
6175
7007
  }, [isFloating]);
6176
- React19__namespace.useEffect(() => {
7008
+ React21__namespace.useEffect(() => {
6177
7009
  const check = () => {
6178
7010
  var _a;
6179
7011
  const target = (_a = galleryRef.current) != null ? _a : pricingBarRef.current;
@@ -6184,7 +7016,7 @@ function TripPage({
6184
7016
  check();
6185
7017
  return () => document.removeEventListener("scroll", check, { capture: true });
6186
7018
  }, []);
6187
- React19__namespace.useEffect(() => {
7019
+ React21__namespace.useEffect(() => {
6188
7020
  const check = () => {
6189
7021
  if (!pricingBarRef.current) return;
6190
7022
  setNavHidden(pricingBarRef.current.getBoundingClientRect().top < window.innerHeight * 0.92);
@@ -6193,7 +7025,7 @@ function TripPage({
6193
7025
  check();
6194
7026
  return () => document.removeEventListener("scroll", check, { capture: true });
6195
7027
  }, []);
6196
- React19__namespace.useEffect(() => {
7028
+ React21__namespace.useEffect(() => {
6197
7029
  if (sections.length === 0) return;
6198
7030
  setActiveSection(sections[0].id);
6199
7031
  const update = () => {
@@ -6910,21 +7742,21 @@ function LeadCapturePopup({
6910
7742
  }) {
6911
7743
  var _a;
6912
7744
  const config = __spreadValues(__spreadValues({}, DEFAULTS), _config);
6913
- const [open, setOpen] = React19.useState(false);
6914
- const [closing, setClosing] = React19.useState(false);
6915
- const [submitted, setSubmitted] = React19.useState(false);
6916
- const [submitting, setSubmitting] = React19.useState(false);
6917
- const [error, setError] = React19.useState(null);
6918
- const [name, setName] = React19.useState("");
6919
- const [email, setEmail] = React19.useState("");
6920
- const [travelDate, setTravelDate] = React19.useState("");
6921
- const panelRef = React19.useRef(null);
6922
- const nameRef = React19.useRef(null);
6923
- const show = React19.useCallback(() => {
7745
+ const [open, setOpen] = React21.useState(false);
7746
+ const [closing, setClosing] = React21.useState(false);
7747
+ const [submitted, setSubmitted] = React21.useState(false);
7748
+ const [submitting, setSubmitting] = React21.useState(false);
7749
+ const [error, setError] = React21.useState(null);
7750
+ const [name, setName] = React21.useState("");
7751
+ const [email, setEmail] = React21.useState("");
7752
+ const [travelDate, setTravelDate] = React21.useState("");
7753
+ const panelRef = React21.useRef(null);
7754
+ const nameRef = React21.useRef(null);
7755
+ const show = React21.useCallback(() => {
6924
7756
  if (isDismissed()) return;
6925
7757
  setOpen(true);
6926
7758
  }, []);
6927
- React19.useEffect(() => {
7759
+ React21.useEffect(() => {
6928
7760
  var _a2;
6929
7761
  if (isDismissed()) return;
6930
7762
  if (config.trigger === "delay") {
@@ -6951,7 +7783,7 @@ function LeadCapturePopup({
6951
7783
  return () => window.removeEventListener("scroll", handler);
6952
7784
  }
6953
7785
  }, [config.trigger, config.delaySeconds, config.scrollPercent, show]);
6954
- React19.useEffect(() => {
7786
+ React21.useEffect(() => {
6955
7787
  if (open && !submitted) {
6956
7788
  requestAnimationFrame(() => {
6957
7789
  var _a2;
@@ -6959,7 +7791,7 @@ function LeadCapturePopup({
6959
7791
  });
6960
7792
  }
6961
7793
  }, [open, submitted]);
6962
- const close = React19.useCallback(() => {
7794
+ const close = React21.useCallback(() => {
6963
7795
  setClosing(true);
6964
7796
  setDismissed(config.dismissDays);
6965
7797
  setTimeout(() => {
@@ -6967,7 +7799,7 @@ function LeadCapturePopup({
6967
7799
  setClosing(false);
6968
7800
  }, 250);
6969
7801
  }, [config.dismissDays]);
6970
- React19.useEffect(() => {
7802
+ React21.useEffect(() => {
6971
7803
  if (!open) return;
6972
7804
  const handler = (e) => {
6973
7805
  if (e.key === "Escape") close();
@@ -6975,7 +7807,7 @@ function LeadCapturePopup({
6975
7807
  document.addEventListener("keydown", handler);
6976
7808
  return () => document.removeEventListener("keydown", handler);
6977
7809
  }, [open, close]);
6978
- const onOverlayClick = React19.useCallback(
7810
+ const onOverlayClick = React21.useCallback(
6979
7811
  (e) => {
6980
7812
  if (panelRef.current && !panelRef.current.contains(e.target)) {
6981
7813
  close();
@@ -7209,6 +8041,7 @@ function LeadCapturePopup({
7209
8041
 
7210
8042
  exports.ActivityCard = ActivityCard;
7211
8043
  exports.Alert = Alert;
8044
+ exports.BirthDateField = BirthDateField;
7212
8045
  exports.BookingConfirmation = BookingConfirmation;
7213
8046
  exports.BookingConfirmationEmail = BookingConfirmationEmail;
7214
8047
  exports.BookingConfirmedCard = BookingConfirmedCard;
@@ -7236,6 +8069,8 @@ exports.PaymentModalShell = PaymentModalShell;
7236
8069
  exports.PhoneCountrySelect = PhoneCountrySelect;
7237
8070
  exports.PhotoGallery = PhotoGallery;
7238
8071
  exports.PricingTrip = PricingTrip;
8072
+ exports.RegistrationForm = RegistrationForm;
8073
+ exports.RegistrationSuccessCard = RegistrationSuccessCard;
7239
8074
  exports.SiteHeader = SiteHeader;
7240
8075
  exports.TermsSection = TermsSection;
7241
8076
  exports.ThemeToggle = ThemeToggle;