@qite/tide-booking-component 1.0.0 → 1.0.2

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.
Files changed (23) hide show
  1. package/build/build-cjs/booking-wizard/features/booking/booking-slice.d.ts +3 -13
  2. package/build/build-cjs/booking-wizard/features/booking/selectors.d.ts +13 -19
  3. package/build/build-cjs/booking-wizard/features/product-options/option-pax-card.d.ts +5 -1
  4. package/build/build-cjs/booking-wizard/features/product-options/option-room.d.ts +2 -0
  5. package/build/build-cjs/booking-wizard/types.d.ts +8 -7
  6. package/build/build-cjs/index.js +134 -289
  7. package/build/build-esm/booking-wizard/features/booking/booking-slice.d.ts +3 -13
  8. package/build/build-esm/booking-wizard/features/booking/selectors.d.ts +13 -19
  9. package/build/build-esm/booking-wizard/features/product-options/option-pax-card.d.ts +5 -1
  10. package/build/build-esm/booking-wizard/features/product-options/option-room.d.ts +2 -0
  11. package/build/build-esm/booking-wizard/types.d.ts +8 -7
  12. package/build/build-esm/index.js +134 -289
  13. package/package.json +71 -71
  14. package/src/booking-wizard/components/step-indicator.tsx +1 -1
  15. package/src/booking-wizard/features/booking/booking.tsx +7 -6
  16. package/src/booking-wizard/features/booking/selectors.ts +9 -3
  17. package/src/booking-wizard/features/product-options/option-pax-card.tsx +18 -3
  18. package/src/booking-wizard/features/product-options/option-room.tsx +13 -1
  19. package/src/booking-wizard/features/product-options/options-form.tsx +10 -6
  20. package/src/booking-wizard/features/travelers-form/travelers-form.tsx +3 -3
  21. package/src/booking-wizard/features/travelers-form/validate-form.ts +1 -1
  22. package/src/booking-wizard/settings-context.ts +7 -4
  23. package/src/booking-wizard/types.ts +3 -0
@@ -7235,22 +7235,12 @@ var selectRequestRooms = function (state) {
7235
7235
  var selectOfficeId = function (state) {
7236
7236
  return state.booking.officeId;
7237
7237
  };
7238
- var selectEntryStatus = function (state) {
7239
- return state.booking.entryStatus;
7240
- };
7241
- var selectCustomEntryStatusId = function (state) {
7242
- return state.booking.customEntryStatusId;
7243
- };
7244
7238
  var selectBookingOptions = function (state) {
7245
7239
  return state.booking.bookingOptions;
7246
7240
  };
7247
7241
  var selectBookingType = function (state) {
7248
7242
  return state.booking.bookingType;
7249
7243
  };
7250
- // export const selectB2BEntryStatus = (state: RootState) =>
7251
- // state.booking.b2bEntryStatus;
7252
- // export const selectB2BCustomEntryStatusId = (state: RootState) =>
7253
- // state.booking.b2bCustomEntryStatusId;
7254
7244
  var selectTagIds = function (state) {
7255
7245
  return state.booking.tagIds;
7256
7246
  };
@@ -7446,12 +7436,8 @@ var selectBookingPackageRequest = toolkit.createSelector(
7446
7436
  );
7447
7437
  var selectBookingPackageBookRequest = toolkit.createSelector(
7448
7438
  selectBookingPackageRequest,
7449
- selectEntryStatus,
7450
- selectCustomEntryStatusId,
7451
7439
  selectBookingOptions,
7452
7440
  selectBookingType,
7453
- // selectB2BEntryStatus,
7454
- // selectB2BCustomEntryStatusId,
7455
7441
  selectBookingPackagePax,
7456
7442
  selectBookingAddress,
7457
7443
  selectPackageDetails,
@@ -7465,12 +7451,8 @@ var selectBookingPackageBookRequest = toolkit.createSelector(
7465
7451
  selectVoucherCodes,
7466
7452
  function (
7467
7453
  bookingPackageRequest,
7468
- entryStatus,
7469
- customEntryStatusId,
7470
7454
  bookingOptions,
7471
7455
  bookingType,
7472
- // b2bEntryStatus,
7473
- // b2bCustomEntryStatusId,
7474
7456
  pax,
7475
7457
  address,
7476
7458
  packageDetails,
@@ -7483,32 +7465,7 @@ var selectBookingPackageBookRequest = toolkit.createSelector(
7483
7465
  remarks,
7484
7466
  voucherCodes
7485
7467
  ) {
7486
- var _a,
7487
- _b,
7488
- _c,
7489
- _d,
7490
- _e,
7491
- _f,
7492
- _g,
7493
- _h,
7494
- _j,
7495
- _k,
7496
- _l,
7497
- _m,
7498
- _o,
7499
- _p,
7500
- _q,
7501
- _r,
7502
- _s,
7503
- _t,
7504
- _u,
7505
- _v,
7506
- _w;
7507
- if (
7508
- !packageDetails ||
7509
- (pax === null || pax === void 0 ? void 0 : pax.length) == 0
7510
- )
7511
- return null;
7468
+ if (!packageDetails) return null;
7512
7469
  var returnPaymentUrl = false;
7513
7470
  if (
7514
7471
  generatePaymentUrl &&
@@ -7517,188 +7474,52 @@ var selectBookingPackageBookRequest = toolkit.createSelector(
7517
7474
  ) {
7518
7475
  returnPaymentUrl = true;
7519
7476
  }
7520
- console.log("bookingType", bookingType);
7521
- console.log("bookingPackageRequest.agentId", bookingPackageRequest.agentId);
7522
- console.log("bookingOptions", bookingOptions);
7477
+ var entryStatus = 0;
7478
+ var customEntryStatusId = undefined;
7523
7479
  switch (bookingType) {
7524
- case "b2c":
7525
- if (
7526
- ((_a =
7527
- bookingOptions === null || bookingOptions === void 0
7528
- ? void 0
7529
- : bookingOptions.b2c) === null || _a === void 0
7530
- ? void 0
7531
- : _a.tagIds) &&
7532
- ((_b =
7533
- bookingOptions === null || bookingOptions === void 0
7534
- ? void 0
7535
- : bookingOptions.b2c) === null || _b === void 0
7536
- ? void 0
7537
- : _b.tagIds.length) > 0
7538
- ) {
7480
+ case "b2b":
7481
+ if (bookingOptions.b2b.tagIds && bookingOptions.b2b.tagIds.length > 0) {
7539
7482
  tagIds =
7540
7483
  tagIds === null || tagIds === void 0
7541
7484
  ? void 0
7542
- : tagIds.concat(
7543
- (_c =
7544
- bookingOptions === null || bookingOptions === void 0
7545
- ? void 0
7546
- : bookingOptions.b2c) === null || _c === void 0
7547
- ? void 0
7548
- : _c.tagIds
7549
- );
7485
+ : tagIds.concat(bookingOptions.b2b.tagIds);
7550
7486
  }
7551
- if (
7552
- (_d =
7553
- bookingOptions === null || bookingOptions === void 0
7554
- ? void 0
7555
- : bookingOptions.b2c) === null || _d === void 0
7556
- ? void 0
7557
- : _d.entryStatus
7558
- ) {
7559
- entryStatus =
7560
- (_e =
7561
- bookingOptions === null || bookingOptions === void 0
7562
- ? void 0
7563
- : bookingOptions.b2c) === null || _e === void 0
7564
- ? void 0
7565
- : _e.entryStatus;
7487
+ if (bookingOptions.b2b.entryStatus) {
7488
+ entryStatus = bookingOptions.b2b.entryStatus;
7566
7489
  }
7567
- if (
7568
- (_f =
7569
- bookingOptions === null || bookingOptions === void 0
7570
- ? void 0
7571
- : bookingOptions.b2c) === null || _f === void 0
7572
- ? void 0
7573
- : _f.customEntryStatusId
7574
- ) {
7575
- customEntryStatusId =
7576
- (_g =
7577
- bookingOptions === null || bookingOptions === void 0
7578
- ? void 0
7579
- : bookingOptions.b2c) === null || _g === void 0
7580
- ? void 0
7581
- : _g.customEntryStatusId;
7490
+ if (bookingOptions.b2b.customEntryStatusId) {
7491
+ customEntryStatusId = bookingOptions.b2b.customEntryStatusId;
7582
7492
  }
7583
7493
  break;
7584
- case "b2b":
7494
+ case "b2b2c":
7585
7495
  if (
7586
- ((_h =
7587
- bookingOptions === null || bookingOptions === void 0
7588
- ? void 0
7589
- : bookingOptions.b2b) === null || _h === void 0
7590
- ? void 0
7591
- : _h.tagIds) &&
7592
- ((_j =
7593
- bookingOptions === null || bookingOptions === void 0
7594
- ? void 0
7595
- : bookingOptions.b2b) === null || _j === void 0
7596
- ? void 0
7597
- : _j.tagIds.length) > 0
7496
+ bookingOptions.b2b2c.tagIds &&
7497
+ bookingOptions.b2b2c.tagIds.length > 0
7598
7498
  ) {
7599
7499
  tagIds =
7600
7500
  tagIds === null || tagIds === void 0
7601
7501
  ? void 0
7602
- : tagIds.concat(
7603
- (_k =
7604
- bookingOptions === null || bookingOptions === void 0
7605
- ? void 0
7606
- : bookingOptions.b2b) === null || _k === void 0
7607
- ? void 0
7608
- : _k.tagIds
7609
- );
7502
+ : tagIds.concat(bookingOptions.b2b2c.tagIds);
7610
7503
  }
7611
- if (
7612
- (_l =
7613
- bookingOptions === null || bookingOptions === void 0
7614
- ? void 0
7615
- : bookingOptions.b2b) === null || _l === void 0
7616
- ? void 0
7617
- : _l.entryStatus
7618
- ) {
7619
- entryStatus =
7620
- (_m =
7621
- bookingOptions === null || bookingOptions === void 0
7622
- ? void 0
7623
- : bookingOptions.b2b) === null || _m === void 0
7624
- ? void 0
7625
- : _m.entryStatus;
7504
+ if (bookingOptions.b2b2c.entryStatus) {
7505
+ entryStatus = bookingOptions.b2b2c.entryStatus;
7626
7506
  }
7627
- if (
7628
- (_o =
7629
- bookingOptions === null || bookingOptions === void 0
7630
- ? void 0
7631
- : bookingOptions.b2b) === null || _o === void 0
7632
- ? void 0
7633
- : _o.customEntryStatusId
7634
- ) {
7635
- customEntryStatusId =
7636
- (_p =
7637
- bookingOptions === null || bookingOptions === void 0
7638
- ? void 0
7639
- : bookingOptions.b2b) === null || _p === void 0
7640
- ? void 0
7641
- : _p.customEntryStatusId;
7507
+ if (bookingOptions.b2b2c.customEntryStatusId) {
7508
+ customEntryStatusId = bookingOptions.b2b2c.customEntryStatusId;
7642
7509
  }
7643
7510
  break;
7644
- case "b2b2c":
7645
- if (
7646
- ((_q =
7647
- bookingOptions === null || bookingOptions === void 0
7648
- ? void 0
7649
- : bookingOptions.b2b2c) === null || _q === void 0
7650
- ? void 0
7651
- : _q.tagIds) &&
7652
- ((_r =
7653
- bookingOptions === null || bookingOptions === void 0
7654
- ? void 0
7655
- : bookingOptions.b2b2c) === null || _r === void 0
7656
- ? void 0
7657
- : _r.tagIds.length) > 0
7658
- ) {
7511
+ default:
7512
+ if (bookingOptions.b2c.tagIds && bookingOptions.b2c.tagIds.length > 0) {
7659
7513
  tagIds =
7660
7514
  tagIds === null || tagIds === void 0
7661
7515
  ? void 0
7662
- : tagIds.concat(
7663
- (_s =
7664
- bookingOptions === null || bookingOptions === void 0
7665
- ? void 0
7666
- : bookingOptions.b2b2c) === null || _s === void 0
7667
- ? void 0
7668
- : _s.tagIds
7669
- );
7516
+ : tagIds.concat(bookingOptions.b2c.tagIds);
7670
7517
  }
7671
- if (
7672
- (_t =
7673
- bookingOptions === null || bookingOptions === void 0
7674
- ? void 0
7675
- : bookingOptions.b2b2c) === null || _t === void 0
7676
- ? void 0
7677
- : _t.entryStatus
7678
- ) {
7679
- entryStatus =
7680
- (_u =
7681
- bookingOptions === null || bookingOptions === void 0
7682
- ? void 0
7683
- : bookingOptions.b2b2c) === null || _u === void 0
7684
- ? void 0
7685
- : _u.entryStatus;
7518
+ if (bookingOptions.b2c.entryStatus) {
7519
+ entryStatus = bookingOptions.b2c.entryStatus;
7686
7520
  }
7687
- if (
7688
- (_v =
7689
- bookingOptions === null || bookingOptions === void 0
7690
- ? void 0
7691
- : bookingOptions.b2b2c) === null || _v === void 0
7692
- ? void 0
7693
- : _v.customEntryStatusId
7694
- ) {
7695
- customEntryStatusId =
7696
- (_w =
7697
- bookingOptions === null || bookingOptions === void 0
7698
- ? void 0
7699
- : bookingOptions.b2b2c) === null || _w === void 0
7700
- ? void 0
7701
- : _w.customEntryStatusId;
7521
+ if (bookingOptions.b2c.customEntryStatusId) {
7522
+ customEntryStatusId = bookingOptions.b2c.customEntryStatusId;
7702
7523
  }
7703
7524
  break;
7704
7525
  }
@@ -7707,7 +7528,12 @@ var selectBookingPackageBookRequest = toolkit.createSelector(
7707
7528
  status: entryStatus,
7708
7529
  customStatusId: customEntryStatusId,
7709
7530
  address: address,
7710
- pax: pax,
7531
+ pax:
7532
+ (pax === null || pax === void 0 ? void 0 : pax.length) != 0
7533
+ ? pax
7534
+ : packageDetails.options[0].requestRooms.flatMap(function (x) {
7535
+ return x.pax;
7536
+ }),
7711
7537
  nonTravelPax: [],
7712
7538
  calculateDeposit: calculateDeposit,
7713
7539
  returnPaymentUrl: returnPaymentUrl,
@@ -7716,7 +7542,6 @@ var selectBookingPackageBookRequest = toolkit.createSelector(
7716
7542
  remarks: remarks,
7717
7543
  voucherCodes: voucherCodes,
7718
7544
  };
7719
- console.log("bookingPackageRequest", bookingPackageRequest);
7720
7545
  return bookingPackageRequest;
7721
7546
  }
7722
7547
  );
@@ -7796,28 +7621,24 @@ var packageApi = {
7796
7621
  var _a;
7797
7622
  var initialState$1 = {
7798
7623
  officeId: 1,
7799
- entryStatus: 0,
7800
- customEntryStatusId: undefined,
7801
7624
  bookingOptions: {
7802
7625
  b2b: {
7803
- tagIds: [9],
7626
+ tagIds: [],
7804
7627
  entryStatus: 2,
7805
7628
  customEntryStatusId: undefined,
7806
7629
  },
7807
7630
  b2b2c: {
7808
- tagIds: [11],
7631
+ tagIds: [],
7809
7632
  entryStatus: 2,
7810
7633
  customEntryStatusId: undefined,
7811
7634
  },
7812
7635
  b2c: {
7813
- tagIds: [10],
7636
+ tagIds: [],
7814
7637
  entryStatus: 0,
7815
7638
  customEntryStatusId: undefined,
7816
7639
  },
7817
7640
  },
7818
7641
  bookingType: "b2c",
7819
- // b2bEntryStatus: 2,
7820
- // b2bCustomEntryStatusId: undefined,
7821
7642
  productAttributes: undefined,
7822
7643
  bookingAttributes: undefined,
7823
7644
  calculateDeposit: false,
@@ -7966,27 +7787,12 @@ var bookingSlice = toolkit.createSlice({
7966
7787
  setOfficeId: function (state, action) {
7967
7788
  state.officeId = action.payload;
7968
7789
  },
7969
- setEntryStatus: function (state, action) {
7970
- state.entryStatus = action.payload;
7971
- },
7972
- setCustomEntryStatusId: function (state, action) {
7973
- state.customEntryStatusId = action.payload;
7974
- },
7975
7790
  setBookingOptions: function (state, action) {
7976
7791
  state.bookingOptions = action.payload;
7977
7792
  },
7978
7793
  setBookingType: function (state, action) {
7979
7794
  state.bookingType = action.payload;
7980
7795
  },
7981
- // setB2BEntryStatus(state, action: PayloadAction<number>) {
7982
- // state.b2bEntryStatus = action.payload;
7983
- // },
7984
- // setB2BCustomEntryStatusId(
7985
- // state,
7986
- // action: PayloadAction<number | undefined>
7987
- // ) {
7988
- // state.b2bCustomEntryStatusId = action.payload;
7989
- // },
7990
7796
  setProductAttributes: function (state, action) {
7991
7797
  state.productAttributes = action.payload;
7992
7798
  },
@@ -8101,12 +7907,8 @@ var bookingSlice = toolkit.createSlice({
8101
7907
  },
8102
7908
  });
8103
7909
  var setOfficeId = ((_a = bookingSlice.actions), _a.setOfficeId),
8104
- setEntryStatus = _a.setEntryStatus,
8105
- setCustomEntryStatusId = _a.setCustomEntryStatusId,
8106
7910
  setBookingOptions = _a.setBookingOptions,
8107
7911
  setBookingType = _a.setBookingType,
8108
- // setB2BEntryStatus,
8109
- // setB2BCustomEntryStatusId,
8110
7912
  setProductAttributes = _a.setProductAttributes,
8111
7913
  setBookingAttributes = _a.setBookingAttributes,
8112
7914
  setCalculateDeposit = _a.setCalculateDeposit,
@@ -8161,10 +7963,6 @@ var SettingsContext = React__default["default"].createContext({
8161
7963
  generatePaymentUrl: false,
8162
7964
  currency: "EUR",
8163
7965
  officeId: 1,
8164
- entryStatus: 0,
8165
- customEntryStatusId: null,
8166
- // b2bEntryStatus: 2,
8167
- // b2bCustomEntryStatusId: null,
8168
7966
  tagIds: [],
8169
7967
  hideAgentSelection: false,
8170
7968
  agentAdressId: undefined,
@@ -8172,7 +7970,10 @@ var SettingsContext = React__default["default"].createContext({
8172
7970
  productPath: "/",
8173
7971
  basePath: "/boeken",
8174
7972
  options: {
8175
- pathSuffix: "/opties",
7973
+ pathSuffix: "/",
7974
+ },
7975
+ travellers: {
7976
+ pathSuffix: "/travellers",
8176
7977
  },
8177
7978
  summary: {
8178
7979
  pathSuffix: "/samenvatting",
@@ -8193,9 +7994,15 @@ var SettingsContext = React__default["default"].createContext({
8193
7994
  loaderComponent: null,
8194
7995
  icons: null,
8195
7996
  bookingOptions: {
8196
- b2b: undefined,
8197
- b2b2c: undefined,
8198
- b2c: undefined,
7997
+ b2b: {
7998
+ entryStatus: 0,
7999
+ },
8000
+ b2b2c: {
8001
+ entryStatus: 0,
8002
+ },
8003
+ b2c: {
8004
+ entryStatus: 0,
8005
+ },
8199
8006
  },
8200
8007
  });
8201
8008
 
@@ -8774,6 +8581,7 @@ var OptionRoom = function (_a) {
8774
8581
  var _b, _c, _d, _e, _f;
8775
8582
  var packageRoom = _a.packageRoom,
8776
8583
  pax = _a.pax,
8584
+ optionPax = _a.optionPax,
8777
8585
  onRoomChange = _a.onRoomChange;
8778
8586
  var selectedOption =
8779
8587
  packageRoom === null || packageRoom === void 0
@@ -8962,6 +8770,28 @@ var OptionRoom = function (_a) {
8962
8770
  return "";
8963
8771
  }
8964
8772
  };
8773
+ var getPaxName = function (id) {
8774
+ var item = pax.find(function (x) {
8775
+ return x.id === id;
8776
+ });
8777
+ if (
8778
+ !(item === null || item === void 0 ? void 0 : item.firstName) &&
8779
+ !(item === null || item === void 0 ? void 0 : item.lastName)
8780
+ ) {
8781
+ var optionPaxItem =
8782
+ optionPax === null || optionPax === void 0
8783
+ ? void 0
8784
+ : optionPax.find(function (x) {
8785
+ return x.id === id;
8786
+ });
8787
+ return optionPaxItem === null || optionPaxItem === void 0
8788
+ ? void 0
8789
+ : optionPaxItem.paxName;
8790
+ }
8791
+ return ""
8792
+ .concat(item === null || item === void 0 ? void 0 : item.firstName, " ")
8793
+ .concat(item === null || item === void 0 ? void 0 : item.lastName[0]);
8794
+ };
8965
8795
  return React__default["default"].createElement(
8966
8796
  "tr",
8967
8797
  null,
@@ -9067,10 +8897,7 @@ var OptionRoom = function (_a) {
9067
8897
  },
9068
8898
  i > 0 && ", ",
9069
8899
  " ",
9070
- p.firstName,
9071
- " ",
9072
- p.lastName[0],
9073
- "."
8900
+ getPaxName(p.id)
9074
8901
  );
9075
8902
  })
9076
8903
  )
@@ -9825,6 +9652,7 @@ var OptionPaxGroup = function (_a) {
9825
9652
 
9826
9653
  var OptionPaxCard = function (_a) {
9827
9654
  var pax = _a.pax,
9655
+ requestRoomsPax = _a.requestRoomsPax,
9828
9656
  parentIndex = _a.parentIndex,
9829
9657
  onPaxChange = _a.onPaxChange;
9830
9658
  var _b = React.useState(),
@@ -9843,10 +9671,18 @@ var OptionPaxCard = function (_a) {
9843
9671
  [pax, toggleStates, setToggleStates]
9844
9672
  );
9845
9673
  var bookingPax = reactRedux.useSelector(selectBookingPackagePax);
9846
- var getPaxName = function (id) {
9674
+ var getPaxName = function (bookingOptionPax) {
9847
9675
  var item = bookingPax.find(function (x) {
9848
- return x.id === id;
9676
+ return x.id === bookingOptionPax.id;
9849
9677
  });
9678
+ if (
9679
+ !(item === null || item === void 0 ? void 0 : item.firstName) &&
9680
+ !(item === null || item === void 0 ? void 0 : item.lastName)
9681
+ ) {
9682
+ return bookingOptionPax === null || bookingOptionPax === void 0
9683
+ ? void 0
9684
+ : bookingOptionPax.paxName;
9685
+ }
9850
9686
  return ""
9851
9687
  .concat(item === null || item === void 0 ? void 0 : item.firstName, " ")
9852
9688
  .concat(item === null || item === void 0 ? void 0 : item.lastName);
@@ -9867,6 +9703,7 @@ var OptionPaxCard = function (_a) {
9867
9703
  React__default["default"].Fragment,
9868
9704
  null,
9869
9705
  pax.map(function (p, i) {
9706
+ var _a, _b;
9870
9707
  return React__default["default"].createElement(
9871
9708
  "div",
9872
9709
  {
@@ -9882,8 +9719,27 @@ var OptionPaxCard = function (_a) {
9882
9719
  React__default["default"].createElement(
9883
9720
  "h3",
9884
9721
  { className: "booking-card__body-heading" },
9885
- getPaxName(p.id)
9722
+ getPaxName(p)
9886
9723
  ),
9724
+ ((_a =
9725
+ requestRoomsPax === null || requestRoomsPax === void 0
9726
+ ? void 0
9727
+ : requestRoomsPax.find(function (x) {
9728
+ return x.id == p.id;
9729
+ })) === null || _a === void 0
9730
+ ? void 0
9731
+ : _a.age) &&
9732
+ React__default["default"].createElement(
9733
+ "p",
9734
+ { className: "form__region-label" },
9735
+ ((_b = requestRoomsPax.find(function (x) {
9736
+ return x.id == p.id;
9737
+ })) === null || _b === void 0
9738
+ ? void 0
9739
+ : _b.age) > CHILD_MAX_AGE
9740
+ ? translations.TRAVELERS_FORM.ADULT
9741
+ : translations.TRAVELERS_FORM.CHILD
9742
+ ),
9887
9743
  React__default["default"].createElement(
9888
9744
  "div",
9889
9745
  { className: "booking-card__actions" },
@@ -10409,11 +10265,16 @@ var OptionBookingGroup = function (_a) {
10409
10265
  var OptionsForm = function () {
10410
10266
  var _a = React.useContext(SettingsContext),
10411
10267
  basePath = _a.basePath,
10412
- summary = _a.summary,
10268
+ travellers = _a.travellers,
10413
10269
  loaderComponent = _a.loaderComponent;
10414
10270
  var dispatch = useAppDispatch();
10415
- var travelerFormValues = reactRedux.useSelector(selectTravelersFormValues);
10416
10271
  var requestRooms = reactRedux.useSelector(selectRequestRooms);
10272
+ var requestRoomsPax =
10273
+ requestRooms === null || requestRooms === void 0
10274
+ ? void 0
10275
+ : requestRooms.flatMap(function (x) {
10276
+ return x.pax;
10277
+ });
10417
10278
  var pax = reactRedux.useSelector(selectBookingPackagePax);
10418
10279
  var packageRooms = reactRedux.useSelector(selectPackageRooms);
10419
10280
  var bookingQueryString = reactRedux.useSelector(selectBookingQueryString);
@@ -10421,29 +10282,36 @@ var OptionsForm = function () {
10421
10282
  var groups = reactRedux.useSelector(selectPackageGroups);
10422
10283
  var optionUnits = reactRedux.useSelector(selectPackageOptionUnits);
10423
10284
  var optionPax = reactRedux.useSelector(selectPackageOptionPax);
10424
- if (!travelerFormValues || !packageRooms) {
10285
+ if (!packageRooms) {
10425
10286
  router.navigate("".concat(basePath, "?").concat(bookingQueryString));
10426
10287
  }
10427
10288
  var getRoomPax = function (index) {
10289
+ var _a;
10428
10290
  var room =
10429
10291
  requestRooms === null || requestRooms === void 0
10430
10292
  ? void 0
10431
10293
  : requestRooms.find(function (x) {
10432
10294
  return x.index == index;
10433
10295
  });
10434
- return pax.filter(function (x) {
10296
+ var bookingPackagePax = pax.filter(function (x) {
10435
10297
  return room === null || room === void 0
10436
10298
  ? void 0
10437
10299
  : room.pax.some(function (y) {
10438
10300
  return y.id == x.id;
10439
10301
  });
10440
10302
  });
10303
+ return bookingPackagePax.length > 0
10304
+ ? bookingPackagePax
10305
+ : (_a = room === null || room === void 0 ? void 0 : room.pax) !== null &&
10306
+ _a !== void 0
10307
+ ? _a
10308
+ : [];
10441
10309
  };
10442
10310
  var handleSubmit = function (e) {
10443
10311
  router.navigate(
10444
10312
  ""
10445
10313
  .concat(basePath)
10446
- .concat(summary.pathSuffix, "?")
10314
+ .concat(travellers.pathSuffix, "?")
10447
10315
  .concat(bookingQueryString)
10448
10316
  );
10449
10317
  e.preventDefault();
@@ -10541,6 +10409,7 @@ var OptionsForm = function () {
10541
10409
  key: room.index,
10542
10410
  packageRoom: room,
10543
10411
  pax: getRoomPax(room.index),
10412
+ optionPax: optionPax,
10544
10413
  onRoomChange: handleOnRoomChange,
10545
10414
  }
10546
10415
  );
@@ -10602,6 +10471,7 @@ var OptionsForm = function () {
10602
10471
  React__default["default"].createElement(OptionPaxCard, {
10603
10472
  pax: optionPax,
10604
10473
  onPaxChange: handleOnPaxChange,
10474
+ requestRoomsPax: requestRoomsPax,
10605
10475
  })
10606
10476
  )
10607
10477
  )
@@ -11384,7 +11254,7 @@ var StepIndicators = function (_a) {
11384
11254
  React__default["default"].createElement(
11385
11255
  "div",
11386
11256
  { className: "step-indicators__items" },
11387
- ["Persoonlijke gegevens", "Samenstellen", "Overzicht", "Bevestiging"].map(
11257
+ ["Samenstellen", "Persoonlijke gegevens", "Overzicht", "Bevestiging"].map(
11388
11258
  function (stepName, index) {
11389
11259
  return React__default["default"].createElement(
11390
11260
  "div",
@@ -12821,7 +12691,7 @@ var validateForm = function (values, agentRequired) {
12821
12691
  lodash.set(
12822
12692
  errors,
12823
12693
  "children[".concat(index, "].birthDate"),
12824
- "Reiziger ".concat(index + 1, ": is geen kind")
12694
+ "Reiziger ".concat(values.adults.length + index + 1, ": is geen kind")
12825
12695
  );
12826
12696
  }
12827
12697
  }
@@ -13011,7 +12881,6 @@ var TravelersForm = function () {
13011
12881
  var childIds = reactRedux.useSelector(selectChildIds);
13012
12882
  var agents = reactRedux.useSelector(selectAgents);
13013
12883
  var agentAdressId = reactRedux.useSelector(selectAgentAdressId);
13014
- console.log("agentAdressId", agentAdressId);
13015
12884
  var initialValues =
13016
12885
  (_a = reactRedux.useSelector(selectTravelersFormValues)) !== null &&
13017
12886
  _a !== void 0
@@ -13062,7 +12931,7 @@ var TravelersForm = function () {
13062
12931
  router.navigate(
13063
12932
  ""
13064
12933
  .concat(settings.basePath)
13065
- .concat(settings.options.pathSuffix, "?")
12934
+ .concat(settings.summary.pathSuffix, "?")
13066
12935
  .concat(bookingQueryString)
13067
12936
  );
13068
12937
  },
@@ -13172,6 +13041,7 @@ var TravelersForm = function () {
13172
13041
  var handleAgentClear = function () {
13173
13042
  formik$1.setFieldValue("travelAgentId", 0);
13174
13043
  formik$1.setFieldValue("travelAgentName", "");
13044
+ dispatch(setBookingType("b2c"));
13175
13045
  };
13176
13046
  var toggleAgent = function (value) {
13177
13047
  setShowAgents(value);
@@ -13801,13 +13671,10 @@ var Booking = function (_a) {
13801
13671
  thumbnailUrl = _a.thumbnailUrl;
13802
13672
  var _b = React.useContext(SettingsContext),
13803
13673
  officeId = _b.officeId,
13804
- entryStatus = _b.entryStatus,
13805
- customEntryStatusId = _b.customEntryStatusId,
13806
13674
  bookingOptions = _b.bookingOptions,
13807
- // b2bEntryStatus,
13808
- // b2bCustomEntryStatusId,
13809
13675
  basePath = _b.basePath,
13810
13676
  options = _b.options,
13677
+ travellers = _b.travellers,
13811
13678
  summary = _b.summary,
13812
13679
  confirmation = _b.confirmation,
13813
13680
  error = _b.error,
@@ -13942,23 +13809,7 @@ var Booking = function (_a) {
13942
13809
  React.useEffect(
13943
13810
  function () {
13944
13811
  dispatch(setOfficeId(officeId));
13945
- dispatch(setEntryStatus(entryStatus));
13946
- dispatch(
13947
- setCustomEntryStatusId(
13948
- customEntryStatusId !== null && customEntryStatusId !== void 0
13949
- ? customEntryStatusId
13950
- : undefined
13951
- )
13952
- );
13953
- dispatch(
13954
- setBookingOptions(
13955
- bookingOptions !== null && bookingOptions !== void 0
13956
- ? bookingOptions
13957
- : undefined
13958
- )
13959
- );
13960
- // dispatch(setB2BEntryStatus(b2bEntryStatus));
13961
- // dispatch(setB2BCustomEntryStatusId(b2bCustomEntryStatusId ?? undefined));
13812
+ dispatch(setBookingOptions(bookingOptions));
13962
13813
  dispatch(setCalculateDeposit(showSidebarDeposit));
13963
13814
  dispatch(
13964
13815
  setTagIds(tagIds !== null && tagIds !== void 0 ? tagIds : undefined)
@@ -13976,15 +13827,9 @@ var Booking = function (_a) {
13976
13827
  },
13977
13828
  [
13978
13829
  officeId,
13979
- entryStatus,
13980
- customEntryStatusId,
13981
13830
  bookingOptions,
13982
- // b2bEntryStatus,
13983
- // b2bCustomEntryStatusId,
13984
13831
  showSidebarDeposit,
13985
13832
  setOfficeId,
13986
- setEntryStatus,
13987
- setCustomEntryStatusId,
13988
13833
  setCalculateDeposit,
13989
13834
  tagIds,
13990
13835
  agentAdressId,
@@ -14027,20 +13872,20 @@ var Booking = function (_a) {
14027
13872
  router.Router,
14028
13873
  { basepath: basePath },
14029
13874
  React__default["default"].createElement(StepRoute, {
14030
- path: "/",
13875
+ path: options.pathSuffix,
14031
13876
  number: 1,
14032
- title: translations.STEPS.PERSONAL_DETAILS,
13877
+ title: translations.STEPS.TRAVEL_OPTIONS,
14033
13878
  component: React__default["default"].createElement(
14034
- TravelersForm,
13879
+ OptionsForm,
14035
13880
  null
14036
13881
  ),
14037
13882
  }),
14038
13883
  React__default["default"].createElement(StepRoute, {
14039
- path: options.pathSuffix,
13884
+ path: travellers.pathSuffix,
14040
13885
  number: 2,
14041
- title: translations.STEPS.TRAVEL_OPTIONS,
13886
+ title: translations.STEPS.PERSONAL_DETAILS,
14042
13887
  component: React__default["default"].createElement(
14043
- OptionsForm,
13888
+ TravelersForm,
14044
13889
  null
14045
13890
  ),
14046
13891
  }),