@sabstravtech/obtservices 0.2.2505201645 → 0.2.2506030830

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 (24) hide show
  1. package/base/lib/vendor/classes/carhire-enterprise-search.d.ts +1 -0
  2. package/base/lib/vendor/classes/user-favourite.enum.d.ts +1 -0
  3. package/base/lib/vendor/interfaces/Icarhire-enterprise-search.d.ts +1 -0
  4. package/base/lib/vendor/interfaces/Ihotel-enterprise-search.d.ts +2 -1
  5. package/base/lib/vendor/interfaces/hotel-stars-to-hide.interface.d.ts +7 -0
  6. package/base/lib/vendor/types/types.d.ts +5 -1
  7. package/base/sabstravtech-obtservices-base.metadata.json +1 -1
  8. package/bundles/sabstravtech-obtservices-base.umd.js +256 -182
  9. package/bundles/sabstravtech-obtservices-base.umd.js.map +1 -1
  10. package/esm2015/base/lib/vendor/classes/carhire-enterprise-search.js +36 -9
  11. package/esm2015/base/lib/vendor/classes/eurostar-enterprise-search.js +58 -26
  12. package/esm2015/base/lib/vendor/classes/fast-track-enterprise-search.js +4 -3
  13. package/esm2015/base/lib/vendor/classes/helpers.js +5 -5
  14. package/esm2015/base/lib/vendor/classes/hotel-enterprise-search.js +22 -31
  15. package/esm2015/base/lib/vendor/classes/user-favourite.enum.js +2 -1
  16. package/esm2015/base/lib/vendor/interfaces/Icarhire-enterprise-search.js +1 -1
  17. package/esm2015/base/lib/vendor/interfaces/Ihotel-enterprise-search.js +1 -1
  18. package/esm2015/base/lib/vendor/interfaces/hotel-stars-to-hide.interface.js +1 -1
  19. package/esm2015/base/lib/vendor/services/hotel-avallibility.service.js +5 -3
  20. package/esm2015/base/lib/vendor/services/search.service.js +25 -14
  21. package/esm2015/base/lib/vendor/types/types.js +10 -2
  22. package/fesm2015/sabstravtech-obtservices-base.js +156 -84
  23. package/fesm2015/sabstravtech-obtservices-base.js.map +1 -1
  24. package/package.json +1 -1
@@ -3146,7 +3146,9 @@
3146
3146
  'exel Breakfast',
3147
3147
  'Breakfast Costs',
3148
3148
  'no breakfast',
3149
- 'ROOM ONL'
3149
+ 'ROOM ONL',
3150
+ 'Fee for buffet breakfast',
3151
+ 'RO/RO'
3150
3152
  ];
3151
3153
  var AccessibleIncluded = [
3152
3154
  'Accessibility',
@@ -3331,7 +3333,13 @@
3331
3333
  ServiceProvider["Trenitalia"] = "Trenitalia";
3332
3334
  ServiceProvider["Renfe"] = "Renfe";
3333
3335
  ServiceProvider["Italo"] = "NTV";
3336
+ ServiceProvider["AmadeusCarHire"] = "Amadeus Car Hire";
3334
3337
  })(exports.ServiceProvider || (exports.ServiceProvider = {}));
3338
+ var nonEnterpriseCarServices = [
3339
+ exports.ServiceProvider.SabreCarHire,
3340
+ exports.ServiceProvider.TravelportCarHire,
3341
+ exports.ServiceProvider.AmadeusCarHire
3342
+ ];
3335
3343
  exports.ResendConfirmationEmailOption = void 0;
3336
3344
  (function (ResendConfirmationEmailOption) {
3337
3345
  ResendConfirmationEmailOption["Agent"] = "Agent";
@@ -7008,7 +7016,7 @@
7008
7016
  };
7009
7017
  BaseHelperRoutines.prototype.createFlightFilters = function (journeys, defaultFilters, via) {
7010
7018
  return journeys.reduce(function (filters, result1) {
7011
- var _a;
7019
+ var _a, _b;
7012
7020
  var outStops = result1.outboundFlights.length - 1;
7013
7021
  filters.stops[outStops] = filters.stops[outStops] || {
7014
7022
  display: outStops === 0 ? 'Direct' : outStops + " stop" + (outStops !== 1 ? 's' : ''),
@@ -7017,7 +7025,7 @@
7017
7025
  };
7018
7026
  var requiresReason = result1.unavailable
7019
7027
  ? exports.TravelPolicies.UNAVAILABLE
7020
- : result1.requiresReasonKeys
7028
+ : ((_a = result1.requiresReasonKeys) === null || _a === void 0 ? void 0 : _a.length)
7021
7029
  ? exports.TravelPolicies.ALLOW_WITH_REASON
7022
7030
  : exports.TravelPolicies.IN_POLICY;
7023
7031
  if (requiresReason !== 'Unavailable') {
@@ -7047,7 +7055,7 @@
7047
7055
  // };
7048
7056
  if (flight.fareInfo.type === 'Private') {
7049
7057
  filters.privateFares[flight.fareInfo.title] = filters.privateFares[flight.fareInfo.title] || {
7050
- display: flight.fareInfo.title,
7058
+ display: flight.fareInfo.title === "Corporate Fare" ? "Client" : flight.fareInfo.title,
7051
7059
  selected: false,
7052
7060
  value: flight.fareInfo.title
7053
7061
  };
@@ -7072,7 +7080,7 @@
7072
7080
  result1.outboundFlights.forEach(getAirline);
7073
7081
  }
7074
7082
  result1.outboundFlights.forEach(updateFlightItems);
7075
- var baggageArray = (_a = result1.baggageAllowance) === null || _a === void 0 ? void 0 : _a.filter(function (a) { return (a === null || a === void 0 ? void 0 : a.type) === 'CheckIn'; }).map(function (a) { return a === null || a === void 0 ? void 0 : a.qty; });
7083
+ var baggageArray = (_b = result1.baggageAllowance) === null || _b === void 0 ? void 0 : _b.filter(function (a) { return (a === null || a === void 0 ? void 0 : a.type) === 'CheckIn'; }).map(function (a) { return a === null || a === void 0 ? void 0 : a.qty; });
7076
7084
  var baggage = baggageArray.length ? Math.min.apply(Math, __spreadArray([], __read(baggageArray))) : 0;
7077
7085
  filters.baggage[baggage] = filters.baggage[baggage] || {
7078
7086
  selected: false,
@@ -9455,6 +9463,7 @@
9455
9463
  UserFavorurite.ReplaceBasketWithIntinerary = new UserFavorurite('replaceBasketWithIntinerary');
9456
9464
  UserFavorurite.useKmForCarHire = new UserFavorurite('useKmForCarHire');
9457
9465
  UserFavorurite.distanceUnit = new UserFavorurite('distanceUnit');
9466
+ UserFavorurite.eurostarSearchDefaults = new UserFavorurite('eurostarSearchDefaults');
9458
9467
  var Suppliers = /** @class */ (function () {
9459
9468
  function Suppliers(value) {
9460
9469
  this.value = value;
@@ -9717,6 +9726,13 @@
9717
9726
  _this._cheapestResultPrice = _this.updateLowestPrice(results);
9718
9727
  _this.averageCo2PerItem = _this.helpers.calculateAverageCo2PerItem(results);
9719
9728
  _this.results.next(results);
9729
+ _this.userService.changeUser.subscribe(function () {
9730
+ var isEnterpriseCarHire = _this.userService.userHasServiceProvider(ServiceType.Car, exports.ServiceProvider.EnterpriseCarHire);
9731
+ _this.hasNonEnterpriseCarAccess = isEnterpriseCarHire ? nonEnterpriseCarServices.some(function (provider) { return _this.userService.userHasServiceProvider(ServiceType.Car, provider); }) : true;
9732
+ if (!_this.hasNonEnterpriseCarAccess) {
9733
+ _this.checkAndSetDriverAgeAndPickupTime();
9734
+ }
9735
+ });
9720
9736
  return _this;
9721
9737
  }
9722
9738
  Object.defineProperty(CarhireEnterpriseSearch.prototype, "adults", {
@@ -10222,7 +10238,7 @@
10222
10238
  });
10223
10239
  CarhireEnterpriseSearch.prototype.checkAndSetDriverAgeAndPickupTime = function () {
10224
10240
  var _a;
10225
- if (this._delivery || this._collection) {
10241
+ if (this._delivery || this._collection || !this.hasNonEnterpriseCarAccess) {
10226
10242
  var minDate = moment__default["default"](this.helpers.momentRoundMinutes(this.helpers.makeMomentDayTime(), 30)).add(24, 'hours');
10227
10243
  this._minDate = {
10228
10244
  day: minDate.date(),
@@ -10254,7 +10270,11 @@
10254
10270
  configurable: true
10255
10271
  });
10256
10272
  CarhireEnterpriseSearch.prototype.resetQuery = function () {
10257
- this.updateTempParams(this.searchService.makeCarHireQuery());
10273
+ var query = this.searchService.makeCarHireQuery();
10274
+ if (!this.hasNonEnterpriseCarAccess) {
10275
+ query.driverAge = this.driverAges[0].value;
10276
+ }
10277
+ this.updateTempParams(query);
10258
10278
  this.estimatedMileage = null;
10259
10279
  this._isValid();
10260
10280
  };
@@ -10310,7 +10330,7 @@
10310
10330
  if ((_a = this.dropoff_datetime) === null || _a === void 0 ? void 0 : _a.isSameOrBefore(this.pickup_datetime, 'minute')) {
10311
10331
  this.addValidationMessage('Dropoff date/time cannot be before or the same as pickup date/time');
10312
10332
  }
10313
- if ((this.delivery || this.collection) && ((_b = this.pickup_datetime) === null || _b === void 0 ? void 0 : _b.isBefore(moment__default["default"]().add(24, 'hours')))) {
10333
+ if ((this.delivery || this.collection || !this.hasNonEnterpriseCarAccess) && ((_b = this.pickup_datetime) === null || _b === void 0 ? void 0 : _b.isBefore(moment__default["default"]().add(24, 'hours')))) {
10314
10334
  this.validationMessages.push('Pickup date/time must be at least 24 hours from now');
10315
10335
  }
10316
10336
  if ((_c = this.pickup_datetime) === null || _c === void 0 ? void 0 : _c.isBefore(moment__default["default"]())) {
@@ -10369,6 +10389,22 @@
10369
10389
  dropoffDateTime: options === null || options === void 0 ? void 0 : options.dropoffDateTime,
10370
10390
  class: options === null || options === void 0 ? void 0 : options.class
10371
10391
  };
10392
+ _this.searchService.getAirportByCode(dropoffDepot.locationCode).pipe(operators.map(function (result) { return result; })).subscribe(function (result) {
10393
+ var _a, _b;
10394
+ if (result.iataMatch) {
10395
+ var match = result.iataMatch;
10396
+ var test = {
10397
+ gateway: match.iata,
10398
+ locationType: LocationType.A,
10399
+ destination: match.name,
10400
+ terminals: match.terminals,
10401
+ country: (_a = match.locationDetails) === null || _a === void 0 ? void 0 : _a.country,
10402
+ countryCode: (_b = match.locationDetails) === null || _b === void 0 ? void 0 : _b.countryCode
10403
+ };
10404
+ _this.pickup_location = test;
10405
+ _this.dropoff_location = test;
10406
+ }
10407
+ });
10372
10408
  return _this.gmtSearch(query).pipe(operators.switchMap(function (result) {
10373
10409
  if (result.length) {
10374
10410
  var preferredOptions = result.filter(function (option) { return option.companyPreferred || option.tmcPreferred; });
@@ -10604,7 +10640,7 @@
10604
10640
  query.airport.dropoffCountryCode = this.dropoff_location.countryCode;
10605
10641
  break;
10606
10642
  case exports.LocationTypes.City:
10607
- if (this.delivery || this.collection) {
10643
+ if (this.delivery || this.collection || !this.hasNonEnterpriseCarAccess) {
10608
10644
  query.location = {
10609
10645
  dropoffCountryCode: this.cityDropoffDepot.countryCode,
10610
10646
  dropoffPostalCode: this.cityDropoffDepot.locationCode,
@@ -10636,7 +10672,7 @@
10636
10672
  // };
10637
10673
  break;
10638
10674
  case exports.LocationTypes.Postcode:
10639
- if (this.delivery || this.collection) {
10675
+ if (this.delivery || this.collection || !this.hasNonEnterpriseCarAccess) {
10640
10676
  query.location = {
10641
10677
  dropoffCountryCode: this.postcodeDropoff.countryCode,
10642
10678
  dropoffPostalCode: this.postcodeDropoff.locationCode,
@@ -10674,7 +10710,7 @@
10674
10710
  query.travellers = this.travellers.map(function (traveller) { return { id: traveller.id }; });
10675
10711
  query.collection = this.collection || null;
10676
10712
  query.delivery = this.delivery || null;
10677
- query.driverAge = this.delivery || this.collection ? this.driverAge : null;
10713
+ query.driverAge = this.delivery || this.collection || !this.hasNonEnterpriseCarAccess ? this.driverAge : null;
10678
10714
  return this.helpers.removeNulls(query);
10679
10715
  };
10680
10716
  /**
@@ -17065,7 +17101,7 @@
17065
17101
  var HotelEnterpriseSearch = /** @class */ (function (_super) {
17066
17102
  __extends(HotelEnterpriseSearch, _super);
17067
17103
  function HotelEnterpriseSearch(hotelFetcher, helpers, userService, environment, avaliabilityService, basketService, storageService, searchService, httpCallService, quickListFetcher, getRailStationFetcher, applyHotelRulesFetcher, getRequestedHotelUpdateFetcher) {
17068
- var _x, _y, _z;
17104
+ var _y, _z, _0;
17069
17105
  var _this = _super.call(this, storageService, helpers, searchService, userService) || this;
17070
17106
  _this.hotelFetcher = hotelFetcher;
17071
17107
  _this.environment = environment;
@@ -17115,38 +17151,38 @@
17115
17151
  month: moment__default["default"]().month() + 1,
17116
17152
  day: moment__default["default"]().date() + 1 // min 1 night stay
17117
17153
  };
17118
- _this.hiddenExtraFilters = (_x = {},
17119
- _x[exports.ExtraSearchHandler.FEMALE_FRIENDLY] = true,
17120
- _x[exports.ExtraSearchHandler.GREEN_HOTEL] = true,
17121
- _x[exports.ExtraSearchHandler.CTM_PARTNERS] = true,
17122
- _x[exports.ExtraSearchHandler.FCDO_HOTEL] = true,
17123
- _x[exports.ExtraSearchHandler.REFUNDABLE] = true,
17124
- _x[exports.ExtraSearchHandler.NON_REFUNDABLE] = true,
17125
- _x[exports.ExtraSearchHandler.ACCESSIBLE_ROOM] = true,
17126
- _x[exports.ExtraSearchHandler.AVAILABILITY] = true,
17127
- _x);
17128
- _this.hiddenAmenitiesFilters = (_y = {},
17129
- _y[exports.AmenitiesSearchHandler.AIR_CONDITIONING] = true,
17130
- _y[exports.AmenitiesSearchHandler.BUSINESS_CENTRE] = true,
17131
- _y[exports.AmenitiesSearchHandler.ELECTRIC_CAR_CHARGING_POINT] = true,
17132
- _y[exports.AmenitiesSearchHandler.EXPRESS_CHECKOUT] = true,
17133
- _y[exports.AmenitiesSearchHandler.GOLF_FACILITIES] = true,
17134
- _y[exports.AmenitiesSearchHandler.ON_SITE_SAFE] = true,
17135
- _y[exports.AmenitiesSearchHandler.PARKING] = true,
17136
- _y[exports.AmenitiesSearchHandler.RESTAURANT] = true,
17137
- _y[exports.AmenitiesSearchHandler.ROOM_SERVICE_24_HOUR] = true,
17138
- _y[exports.AmenitiesSearchHandler.SWIMMING_POOL] = true,
17139
- _y[exports.AmenitiesSearchHandler.WHEELCHAIR_ACCESS] = true,
17140
- _y[exports.AmenitiesSearchHandler.WIFI] = true,
17141
- _y[exports.AmenitiesSearchHandler.ECO_FRIENDLY] = true,
17154
+ _this.hiddenExtraFilters = (_y = {},
17155
+ _y[exports.ExtraSearchHandler.FEMALE_FRIENDLY] = true,
17156
+ _y[exports.ExtraSearchHandler.GREEN_HOTEL] = true,
17157
+ _y[exports.ExtraSearchHandler.CTM_PARTNERS] = true,
17158
+ _y[exports.ExtraSearchHandler.FCDO_HOTEL] = true,
17159
+ _y[exports.ExtraSearchHandler.REFUNDABLE] = true,
17160
+ _y[exports.ExtraSearchHandler.NON_REFUNDABLE] = true,
17161
+ _y[exports.ExtraSearchHandler.ACCESSIBLE_ROOM] = true,
17162
+ _y[exports.ExtraSearchHandler.AVAILABILITY] = true,
17142
17163
  _y);
17143
- _this.hiddenStarRatingFilters = (_z = {},
17144
- _z[exports.StarRating.TwoStar] = true,
17145
- _z[exports.StarRating.ThreeStar] = true,
17146
- _z[exports.StarRating.FourStar] = true,
17147
- _z[exports.StarRating.FiveStar] = true,
17148
- _z[exports.StarRating.Unrated] = true,
17164
+ _this.hiddenAmenitiesFilters = (_z = {},
17165
+ _z[exports.AmenitiesSearchHandler.AIR_CONDITIONING] = true,
17166
+ _z[exports.AmenitiesSearchHandler.BUSINESS_CENTRE] = true,
17167
+ _z[exports.AmenitiesSearchHandler.ELECTRIC_CAR_CHARGING_POINT] = true,
17168
+ _z[exports.AmenitiesSearchHandler.EXPRESS_CHECKOUT] = true,
17169
+ _z[exports.AmenitiesSearchHandler.GOLF_FACILITIES] = true,
17170
+ _z[exports.AmenitiesSearchHandler.ON_SITE_SAFE] = true,
17171
+ _z[exports.AmenitiesSearchHandler.PARKING] = true,
17172
+ _z[exports.AmenitiesSearchHandler.RESTAURANT] = true,
17173
+ _z[exports.AmenitiesSearchHandler.ROOM_SERVICE_24_HOUR] = true,
17174
+ _z[exports.AmenitiesSearchHandler.SWIMMING_POOL] = true,
17175
+ _z[exports.AmenitiesSearchHandler.WHEELCHAIR_ACCESS] = true,
17176
+ _z[exports.AmenitiesSearchHandler.WIFI] = true,
17177
+ _z[exports.AmenitiesSearchHandler.ECO_FRIENDLY] = true,
17149
17178
  _z);
17179
+ _this.hiddenStarRatingFilters = (_0 = {},
17180
+ _0[exports.StarRating.TwoStar] = true,
17181
+ _0[exports.StarRating.ThreeStar] = true,
17182
+ _0[exports.StarRating.FourStar] = true,
17183
+ _0[exports.StarRating.FiveStar] = true,
17184
+ _0[exports.StarRating.Unrated] = true,
17185
+ _0);
17150
17186
  // private variables
17151
17187
  // don't need to worry about times here - maybe normalise these in the request body?
17152
17188
  _this.localFilters = new HotelFilters();
@@ -17199,6 +17235,7 @@
17199
17235
  // console.log('lightning sort results');
17200
17236
  // console.log(this.results.value);
17201
17237
  var filteredResults = _this.resultsFilterMethod(_this.fullResults);
17238
+ console.log(filteredResults);
17202
17239
  _this.results.next(filteredResults);
17203
17240
  _this.reapplySorting.next(true);
17204
17241
  };
@@ -17253,22 +17290,13 @@
17253
17290
  _this._isValid();
17254
17291
  _this.userService.changeUser.subscribe(function () {
17255
17292
  var propertyNumber = _this.userService.userIsAgent() ? [exports.LocationTypes.PropertyNumber] : [];
17256
- if (_this.userService.userHasServiceProvider(ServiceType.Hotel, exports.ServiceProvider.Confirma)) {
17257
- _this.location_types.next(__spreadArray([
17258
- exports.LocationTypes.Airport,
17259
- exports.LocationTypes.City,
17260
- exports.LocationTypes.Office,
17261
- exports.LocationTypes.Shortlist,
17262
- exports.LocationTypes.TrainStation
17263
- ], __read(propertyNumber)));
17264
- }
17265
- else {
17266
- _this.location_types.next(__spreadArray([
17267
- exports.LocationTypes.Airport,
17268
- exports.LocationTypes.City,
17269
- exports.LocationTypes.TrainStation
17270
- ], __read(propertyNumber)));
17271
- }
17293
+ _this.location_types.next(__spreadArray([
17294
+ exports.LocationTypes.Airport,
17295
+ exports.LocationTypes.City,
17296
+ exports.LocationTypes.Office,
17297
+ exports.LocationTypes.Shortlist,
17298
+ exports.LocationTypes.TrainStation
17299
+ ], __read(propertyNumber)));
17272
17300
  if (searchService.shouldFetchAllOffices()) {
17273
17301
  _this.offices.next([]); // TODO fetch offices
17274
17302
  }
@@ -17918,12 +17946,12 @@
17918
17946
  // Combine the observables
17919
17947
  if (availabilityObservables.length) {
17920
17948
  return rxjs.combineLatest(availabilityObservables).pipe(operators.map(function (combinedResults) {
17921
- combinedResults.forEach(function (_x) {
17922
- var hotelAvaliability = _x.hotelAvaliability, hotelDetails = _x.hotelDetails;
17949
+ combinedResults.forEach(function (_y) {
17950
+ var hotelAvaliability = _y.hotelAvaliability, hotelDetails = _y.hotelDetails;
17923
17951
  hotelDetails.availableRates = hotelAvaliability;
17924
17952
  });
17925
- return combinedResults.map(function (_x) {
17926
- var hotelDetails = _x.hotelDetails;
17953
+ return combinedResults.map(function (_y) {
17954
+ var hotelDetails = _y.hotelDetails;
17927
17955
  return hotelDetails;
17928
17956
  });
17929
17957
  }));
@@ -18987,8 +19015,8 @@
18987
19015
  return __awaiter(this, void 0, void 0, function () {
18988
19016
  var fullHotel, searchQuery, roomCsl, detailRooms, intBasket, basket, paxPerRoom, roomArray, numberToSplit_1, bookedTravellersChunks_1, hotelAaddress_1, termsAndConditions_1;
18989
19017
  var _this = this;
18990
- return __generator(this, function (_x) {
18991
- switch (_x.label) {
19018
+ return __generator(this, function (_y) {
19019
+ switch (_y.label) {
18992
19020
  case 0:
18993
19021
  console.log(hotel);
18994
19022
  console.log(hotelRoom);
@@ -19024,7 +19052,7 @@
19024
19052
  });
19025
19053
  return [4 /*yield*/, this.basketService.getDefaultBasket()];
19026
19054
  case 1:
19027
- intBasket = _x.sent();
19055
+ intBasket = _y.sent();
19028
19056
  basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
19029
19057
  if (!basket) return [3 /*break*/, 3];
19030
19058
  paxPerRoom = this.tempParams.no_of_occupants;
@@ -19034,12 +19062,12 @@
19034
19062
  hotelAaddress_1 = hotel.address;
19035
19063
  termsAndConditions_1 = this.getTermsAndCond(hotelRoom, hotelQuery, hotel.source === exports.ServiceProvider.SabreCSL);
19036
19064
  return [4 /*yield*/, roomArray.reduce(function (current, chunk, index) { return __awaiter(_this, void 0, void 0, function () {
19037
- var _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, wh;
19038
- return __generator(this, function (_x) {
19039
- switch (_x.label) {
19065
+ var _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, wh;
19066
+ return __generator(this, function (_y) {
19067
+ switch (_y.label) {
19040
19068
  case 0: return [4 /*yield*/, current];
19041
19069
  case 1:
19042
- switch (_x.sent()) {
19070
+ switch (_y.sent()) {
19043
19071
  case exports.DifferentInvokdedUserReasons.cancel:
19044
19072
  return [2 /*return*/, exports.DifferentInvokdedUserReasons.cancel];
19045
19073
  case exports.DifferentInvokdedUserReasons.research:
@@ -19063,11 +19091,11 @@
19063
19091
  : 'Conferma',
19064
19092
  county: hotelAaddress_1.addressLine3,
19065
19093
  postcode: hotelAaddress_1.postOrZipCode,
19066
- countryCode: this.location_type_select === exports.LocationTypes.TrainStation &&
19067
- !hotelAaddress_1.countryCode
19068
- ? ((_k = this.trainsStation) === null || _k === void 0 ? void 0 : _k.countryCode) ||
19069
- ((_l = this.trainsStation) === null || _l === void 0 ? void 0 : _l.railstation.locationDetails.countryCode)
19070
- : this.location_type_select === exports.LocationTypes.Airport && !hotelAaddress_1.countryCode ? (_o = (_m = this.location) === null || _m === void 0 ? void 0 : _m.locationDetails) === null || _o === void 0 ? void 0 : _o.countryCode : hotelAaddress_1.countryCode
19094
+ countryCode: this.location_type_select === exports.LocationTypes.TrainStation && !hotelAaddress_1.countryCode
19095
+ ? ((_k = this.trainsStation) === null || _k === void 0 ? void 0 : _k.countryCode) || ((_l = this.trainsStation) === null || _l === void 0 ? void 0 : _l.railstation.locationDetails.countryCode)
19096
+ : this.location_type_select === exports.LocationTypes.Airport && !hotelAaddress_1.countryCode
19097
+ ? ((_o = (_m = this.location) === null || _m === void 0 ? void 0 : _m.airport) === null || _o === void 0 ? void 0 : _o.countryCode) || ((_p = this.location) === null || _p === void 0 ? void 0 : _p.locationDetails.countryCode)
19098
+ : hotelAaddress_1.countryCode,
19071
19099
  },
19072
19100
  hotelDescription: hotel.group,
19073
19101
  hotelFaxNumber: hotelAaddress_1.facsimile,
@@ -19082,9 +19110,9 @@
19082
19110
  hotelPreferred: hotel.preferred,
19083
19111
  hotelDistance: {
19084
19112
  search: hotel.location.distance.toFixed(2),
19085
- airport: (_q = (_p = hotel.transports) === null || _p === void 0 ? void 0 : _p.find(function (a) { return a.type == exports.HotelDetailTypes.AIRPORT; })) === null || _q === void 0 ? void 0 : _q.distance.toFixed(2),
19086
- train: (_s = (_r = hotel.transports) === null || _r === void 0 ? void 0 : _r.find(function (a) { return a.type == exports.HotelDetailTypes.TRAIN; })) === null || _s === void 0 ? void 0 : _s.distance.toFixed(2),
19087
- metro: (_u = (_t = hotel.transports) === null || _t === void 0 ? void 0 : _t.find(function (a) { return a.type == exports.HotelDetailTypes.METRO; })) === null || _u === void 0 ? void 0 : _u.distance.toFixed(2)
19113
+ airport: (_r = (_q = hotel.transports) === null || _q === void 0 ? void 0 : _q.find(function (a) { return a.type == exports.HotelDetailTypes.AIRPORT; })) === null || _r === void 0 ? void 0 : _r.distance.toFixed(2),
19114
+ train: (_t = (_s = hotel.transports) === null || _s === void 0 ? void 0 : _s.find(function (a) { return a.type == exports.HotelDetailTypes.TRAIN; })) === null || _t === void 0 ? void 0 : _t.distance.toFixed(2),
19115
+ metro: (_v = (_u = hotel.transports) === null || _u === void 0 ? void 0 : _u.find(function (a) { return a.type == exports.HotelDetailTypes.METRO; })) === null || _v === void 0 ? void 0 : _v.distance.toFixed(2)
19088
19116
  },
19089
19117
  location: {
19090
19118
  longitude: hotel.location.longitude,
@@ -19097,8 +19125,8 @@
19097
19125
  searchQuery: searchQuery,
19098
19126
  outboundDate: hotelQuery.startDate,
19099
19127
  inboundDate: hotelQuery.endDate,
19100
- lowestPrice: (_v = this.cheapestPrice) === null || _v === void 0 ? void 0 : _v.amount,
19101
- lowestPriceCurrency: (_w = this.cheapestPrice) === null || _w === void 0 ? void 0 : _w.currencyCode,
19128
+ lowestPrice: (_w = this.cheapestPrice) === null || _w === void 0 ? void 0 : _w.amount,
19129
+ lowestPriceCurrency: (_x = this.cheapestPrice) === null || _x === void 0 ? void 0 : _x.currencyCode,
19102
19130
  lowestPriceDetail: this.createLowestPriceDetail(hotelQuery),
19103
19131
  co2PerItem: hotel.co2PerItem,
19104
19132
  co2PerPassenger: hotel.co2PerPassenger,
@@ -19109,7 +19137,7 @@
19109
19137
  // chunk
19110
19138
  bookedTravellersChunks_1[index] || [], hotelRoom.requiresReasonKeys, false, ignoreInvoked)];
19111
19139
  case 2:
19112
- wh = _x.sent();
19140
+ wh = _y.sent();
19113
19141
  if (wh === exports.DifferentInvokdedUserReasons.research) {
19114
19142
  this.researchWithNewUser();
19115
19143
  }
@@ -19119,7 +19147,7 @@
19119
19147
  }); }, exports.DifferentInvokdedUserReasons.continue)];
19120
19148
  case 2:
19121
19149
  // bookedTravellersChunks.forEach((chunk: Traveller[], index: number) => {
19122
- return [2 /*return*/, _x.sent()];
19150
+ return [2 /*return*/, _y.sent()];
19123
19151
  case 3: return [2 /*return*/, exports.DifferentInvokdedUserReasons.cancel];
19124
19152
  }
19125
19153
  });
@@ -19182,7 +19210,7 @@
19182
19210
  };
19183
19211
  HotelEnterpriseSearch.prototype.applyFavourite = function (fav) {
19184
19212
  return __awaiter(this, void 0, void 0, function () {
19185
- return __generator(this, function (_x) {
19213
+ return __generator(this, function (_y) {
19186
19214
  this.checkin_date = moment__default["default"]().set('hour', 23).set('minute', 59);
19187
19215
  this.checkout_date = moment__default["default"]().add(1, 'day').set('hour', 23).set('minute', 59);
19188
19216
  this.applySearchQuery(fav);
@@ -19279,7 +19307,7 @@
19279
19307
  return detail;
19280
19308
  };
19281
19309
  HotelEnterpriseSearch.prototype.noRoomFilterSelected = function () {
19282
- var _x = this.filters, refundableRoomType = _x.refundableRoomType, priceRange = _x.priceRange, roomType = _x.roomType, accessibleRoomType = _x.accessibleRoomType, breakfastType = _x.breakfastType, crownPreferred = _x.crownPreferred;
19310
+ var _y = this.filters, refundableRoomType = _y.refundableRoomType, priceRange = _y.priceRange, roomType = _y.roomType, accessibleRoomType = _y.accessibleRoomType, breakfastType = _y.breakfastType, crownPreferred = _y.crownPreferred;
19283
19311
  return !accessibleRoomType.length && !refundableRoomType.length && !roomType.length && priceRange.min === 0 && priceRange.max === Number.MAX_SAFE_INTEGER && (!breakfastType.length || breakfastType.length === 2) && !crownPreferred.length;
19284
19312
  };
19285
19313
  // We use this method for features: RecentSearch, FavouriteSearch, ExpiredBasket, CopyBasket, CloneBasket
@@ -19288,10 +19316,10 @@
19288
19316
  if (startSearch === void 0) { startSearch = false; }
19289
19317
  if (cloneBasketItem === void 0) { cloneBasketItem = false; }
19290
19318
  return __awaiter(this, void 0, void 0, function () {
19291
- var _x, fetchLocation$, offices;
19319
+ var _y, fetchLocation$, offices;
19292
19320
  var _this = this;
19293
- return __generator(this, function (_y) {
19294
- switch (_y.label) {
19321
+ return __generator(this, function (_z) {
19322
+ switch (_z.label) {
19295
19323
  case 0:
19296
19324
  this.currency = query.currency;
19297
19325
  this.distance = query.distance;
@@ -19318,8 +19346,8 @@
19318
19346
  else {
19319
19347
  this.location_type_select = exports.LocationTypes.City;
19320
19348
  }
19321
- _x = this.location_type_select;
19322
- switch (_x) {
19349
+ _y = this.location_type_select;
19350
+ switch (_y) {
19323
19351
  case exports.LocationTypes.Airport: return [3 /*break*/, 1];
19324
19352
  case exports.LocationTypes.City: return [3 /*break*/, 2];
19325
19353
  case exports.LocationTypes.Office: return [3 /*break*/, 3];
@@ -19351,7 +19379,7 @@
19351
19379
  : null;
19352
19380
  fetchLocation$.subscribe(function (locations) {
19353
19381
  var locationMatch = query.postOrZipCode
19354
- ? locations.find(function (loc) { return loc.postcode === query.postOrZipCode; })
19382
+ ? locations.find(function (loc) { return loc.postcode === query.postOrZipCode || loc.name === query.postOrZipCode; })
19355
19383
  : locations.find(function (loc) { return loc.name === query.cityName; });
19356
19384
  if (query.postOrZipCode) {
19357
19385
  _this.postcode = locationMatch || null;
@@ -19369,7 +19397,7 @@
19369
19397
  return [3 /*break*/, 8];
19370
19398
  case 3: return [4 /*yield*/, this.searchService.getOfficeLocationsNoUserAddresses().toPromise()];
19371
19399
  case 4:
19372
- offices = _y.sent();
19400
+ offices = _z.sent();
19373
19401
  this.office = offices.find(function (office) { return Number(office.id) === Number(query.officeId); });
19374
19402
  if (startSearch) {
19375
19403
  this.searchService.startSearches();
@@ -21312,8 +21340,10 @@
21312
21340
  });
21313
21341
  }
21314
21342
  userService.changeUser.subscribe(function (user) {
21343
+ var _a;
21315
21344
  _this.timeCriteriaOptions.next([exports.TimeWindow.Anytime, exports.TimeWindow.Arrive, exports.TimeWindow.Depart]); // TODO update with any UFs
21316
- _this.updateAvaliableClasses();
21345
+ var classesToHide = (_a = _this.userService.getUserFavoriteObject(UserFavorurite.eurostarSearchDefaults)) === null || _a === void 0 ? void 0 : _a.hideEurostarClasses;
21346
+ _this.updateAvaliableClasses(classesToHide);
21317
21347
  });
21318
21348
  _this.updateTravellers();
21319
21349
  var results = storageService.getSessionItem(_this.resultsSessionName) || {
@@ -21325,7 +21355,6 @@
21325
21355
  _this.fullResults = _this.helpers.clone(results.results);
21326
21356
  _this.flightsToGroup = results.groupData || {};
21327
21357
  _this.resultQuery = results.query;
21328
- var isFlightsGrouped = _this.searchService.isEuroStarGrouped();
21329
21358
  _this.results.next((results.results || []));
21330
21359
  var resultsClone = _this.helpers.clone(results.results);
21331
21360
  // get around the annoying type restrictions - I KNOW JOURNEYS IS THERE I CAN SEE IT STOP TELLING ME IT ISN'T TYPESCRIPT!
@@ -22069,6 +22098,7 @@
22069
22098
  returnObject.standardFare.unavailableMessage = hasField(journeyHash, 'unavailableMessage', '');
22070
22099
  returnObject.standardFare.requiresReasonKeys = hasField(journeyHash, 'requiresReasonKeys', []);
22071
22100
  returnObject.standardFare.requiresReasonMessages = hasField(journeyHash, 'requiresReasonMessages', []);
22101
+ break;
22072
22102
  case 'standardPremierFare':
22073
22103
  returnObject.standardPremierFare.companyPreferred =
22074
22104
  ((_y = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _y === void 0 ? void 0 : _y.companyPreferred) ||
@@ -22111,6 +22141,7 @@
22111
22141
  returnObject.standardPremierFare.unavailableMessage = hasField(journeyHash, 'unavailableMessage', '');
22112
22142
  returnObject.standardPremierFare.requiresReasonKeys = hasField(journeyHash, 'requiresReasonKeys', []);
22113
22143
  returnObject.standardPremierFare.requiresReasonMessages = hasField(journeyHash, 'requiresReasonMessages', []);
22144
+ break;
22114
22145
  case 'businessPremierFare':
22115
22146
  returnObject.businessPremierFare.companyPreferred =
22116
22147
  ((_19 = this._ruleActionSummary.journeyWhenSelected[journeyHash]) === null || _19 === void 0 ? void 0 : _19.companyPreferred) ||
@@ -22354,25 +22385,53 @@
22354
22385
  this._passengers = travellers;
22355
22386
  this._isValid();
22356
22387
  };
22357
- EurostarEnterpriseSearch.prototype.updateAvaliableClasses = function () {
22358
- this.avaliableClasses.next([
22359
- {
22388
+ EurostarEnterpriseSearch.prototype.updateAvaliableClasses = function (classesToHide) {
22389
+ var allowedClasses = [{
22360
22390
  name: 'Any',
22361
22391
  type: FlightCabinClass.Any
22362
- },
22363
- {
22364
- name: 'Standard (semi flexible)',
22365
- type: FlightCabinClass.Economy
22366
- },
22367
- {
22368
- name: 'Standard premier (semi flexible)',
22369
- type: FlightCabinClass.PremiumEconomy
22370
- },
22371
- {
22372
- name: 'Business premier (fully flexible)',
22373
- type: FlightCabinClass.Business
22392
+ }];
22393
+ if (classesToHide && Object.keys(classesToHide)) {
22394
+ var business_premier = classesToHide.business_premier, standard = classesToHide.standard, standard_premier = classesToHide.standard_premier;
22395
+ if (!standard) {
22396
+ allowedClasses.push({
22397
+ name: 'Standard (semi flexible)',
22398
+ type: FlightCabinClass.Economy
22399
+ });
22374
22400
  }
22375
- ]);
22401
+ if (!standard_premier) {
22402
+ allowedClasses.push({
22403
+ name: 'Standard premier (semi flexible)',
22404
+ type: FlightCabinClass.PremiumEconomy
22405
+ });
22406
+ }
22407
+ if (!business_premier) {
22408
+ allowedClasses.push({
22409
+ name: 'Business premier (fully flexible)',
22410
+ type: FlightCabinClass.Business
22411
+ });
22412
+ }
22413
+ }
22414
+ else {
22415
+ allowedClasses = [
22416
+ {
22417
+ name: 'Any',
22418
+ type: FlightCabinClass.Any
22419
+ },
22420
+ {
22421
+ name: 'Standard (semi flexible)',
22422
+ type: FlightCabinClass.Economy
22423
+ },
22424
+ {
22425
+ name: 'Standard premier (semi flexible)',
22426
+ type: FlightCabinClass.PremiumEconomy
22427
+ },
22428
+ {
22429
+ name: 'Business premier (fully flexible)',
22430
+ type: FlightCabinClass.Business
22431
+ }
22432
+ ];
22433
+ }
22434
+ this.avaliableClasses.next(allowedClasses);
22376
22435
  };
22377
22436
  /**
22378
22437
  * @description - sort the flight results
@@ -22790,7 +22849,7 @@
22790
22849
  var inJourneyTesters = [];
22791
22850
  inJourneyTesters.push(tester(filters.classes, fieldHasValue('cabinClass')));
22792
22851
  // !- Itineraries
22793
- var outFilterItineraries = function (flightItinerary, groupIndex) {
22852
+ var outFilterItineraries = function (flightItinerary) {
22794
22853
  return (outItineraryTesters.reduce(function (acc, tester1) {
22795
22854
  acc = acc && tester1(flightItinerary);
22796
22855
  return acc;
@@ -22802,7 +22861,7 @@
22802
22861
  }, true);
22803
22862
  })));
22804
22863
  };
22805
- var inFilterItineraries = function (flightItinerary, groupIndex) {
22864
+ var inFilterItineraries = function (flightItinerary) {
22806
22865
  var _a;
22807
22866
  return (inItineraryTesters.reduce(function (acc, tester1) {
22808
22867
  return acc && tester1(flightItinerary);
@@ -33538,6 +33597,7 @@
33538
33597
  }
33539
33598
  else {
33540
33599
  // add the data to the array
33600
+ console.log("+++ Add hotel: " + fullHotel.id + " to behaviours +++");
33541
33601
  this.behaviours[fullHotel.id] =
33542
33602
  new rxjs.BehaviorSubject(null);
33543
33603
  var newBehaviourObject = fullHotel.availableRates;
@@ -33578,6 +33638,7 @@
33578
33638
  {});
33579
33639
  };
33580
33640
  BaseHotelAvalibilityService.prototype.updateHotel = function (hotel) {
33641
+ console.log('updating hotels');
33581
33642
  if (!hotel.availableRates) {
33582
33643
  hotel.availableRates = this.getAvailabilityValue(hotel);
33583
33644
  }
@@ -33612,7 +33673,6 @@
33612
33673
  return hotel;
33613
33674
  };
33614
33675
  BaseHotelAvalibilityService.prototype._getAvailabilityForId = function (hotel) {
33615
- // console.log('+++ Fetching availabilty for: ', hotel, ' +++');
33616
33676
  if (this.timeout) {
33617
33677
  window.clearTimeout(this.timeout);
33618
33678
  this.timeout = 0;
@@ -33713,7 +33773,8 @@
33713
33773
  _this.lowestPriceHotel.price = hotel.minprice;
33714
33774
  }
33715
33775
  hotel.rooms = hotel.rooms;
33716
- hotel.fullRooms = hotel.rooms;
33776
+ hotel.fullRooms = _this.helpers.clone(hotel.rooms);
33777
+ _this.data[hotel.hotelId] = _this.helpers.clone(hotel);
33717
33778
  if ((hotel === null || hotel === void 0 ? void 0 : hotel.hotelId) && _this.behaviours[hotel.hotelId]) {
33718
33779
  _this.data[hotel.hotelId] = hotel;
33719
33780
  _this.behaviours[hotel.hotelId].next(hotel);
@@ -36793,14 +36854,15 @@
36793
36854
  return this.fasttrackFetcher.fetchList(query);
36794
36855
  };
36795
36856
  FastTrackEnterpriseSearch.prototype.getSearchQuery = function () {
36857
+ var _a, _b;
36796
36858
  var query = {
36797
36859
  adults: this.tempParams.adults,
36798
36860
  children: this.tempParams.children ? this.tempParams.children : null,
36799
- locationCode: this._locationCode,
36861
+ locationCode: this._locationCode || ((_a = this.originalUserSearch.locationCode) === null || _a === void 0 ? void 0 : _a.gateway),
36800
36862
  flight: this.tempParams.flightNumber,
36801
36863
  terminal: this.tempParams.terminal === 'Any' ? null : this.tempParams.terminal,
36802
36864
  arrivalDatetime: this.tempParams.arrivalDatetime,
36803
- airportFullName: this.locationCode.destination,
36865
+ airportFullName: this.locationCode.destination || ((_b = this.originalUserSearch.locationCode) === null || _b === void 0 ? void 0 : _b.destination),
36804
36866
  travellers: this.travellers.map(function (traveller) { return { id: traveller.id }; })
36805
36867
  };
36806
36868
  return this.helpers.removeNulls(query);
@@ -38709,7 +38771,7 @@
38709
38771
  })(exports.TravellerSearchTypes || (exports.TravellerSearchTypes = {}));
38710
38772
  var BaseEnterpriseSearchService = /** @class */ (function () {
38711
38773
  function BaseEnterpriseSearchService(searchAirportsFetcher, searchAirlinesFetcher, storageService, userService, modalService, router, helpers, hotelAvalibilityService, citiesFetcher, postcodeFetcher, railStationFetcher, saveUserAddressUpdater, editUserAddressUpdater, userAddressesFetcher, basketService, getUserCompanyOfficesFetcher, searchHotelChainsFetcher, getConfermaRoomImagesFetcher, baseValidateIsPostcodeValidTester, depotFetcher, baseDeleteUserAddressUpdater, baseDeleteRecentSearchUpdater, baseSaveRecentSearchUpdater, getUserCarbonAllowanceFetcher, baseSaveFavouriteSearchUpdater, environment, loungeFetcher, parkingFetcher, httpCallService, flightFetcher, hotelFetcher, carhireFetcher, carHireAvailabilityDetailFetcher, cabhireFetcher, railFetcher, irlFetcher, getRailStationInfoFetcher, getRailStationFetcher, getIrlSupplierStationFetcher, webTokenService, riskAlertsFetcher, quicklistFetcher, getUserRecentSearchesFetcher, getRailCardsFetcher, getCovidMicrositeTokenFetcher, eurostarFetcher, searchUsersCanBookForFetcher, searchIrlStationsFetcher, irlDiscountCardsFetcher, getFlightFareRulesFetcher, getFlightSeatMapFetcher, getRailLiveDeparturesFetcher, applyHotelRulesFetcher, applyFlightRules, getUserFavouriteSearchesFetcher, deleteFavouriteSearchUpdater, emailBasketFetcher, fasttrackFetcher, sendOfflineNotificationFetcher, getHotelChainsFetcher, getRailProvidersFetcher, getAllAirlinesFetcher, getCarHireProvidersFetcher, baseGenerateBasketPdfFetcher, emailFerryFetcher, getFlightExtrasOptions, getRequestedHotelUpdateFetcher, convertCurrencyFetcher, getCurrencyConversionRatesFetcher, getHotelDetailsFetcher, getServiceFetcher, getFlightBrandedFaresFetcher, getTrainlineSearchConfigFetcher, searchRailInwardFetcher, railSearchExchangeFetcher, createItineraryExchangeUpdater, getAirAvailabilityFetcher, getFlightAtNewClassFetcher, getFlightUpsellOffersFetcher, getOfficesFetcher, emailApartmentBookingFetcher, emailSeasonTicketFetcher, suggestPlaces, latLonFromHereID, getGMTItineraryOptions, getGUTCitySuggestions, getGUTLocationSuggestions, getRouteHappyFetcher, getMultipleHotelRatingFetcher, emailMeetingRoomBookingFetcher, flightSearchExchangeFetcher, flighExchangeDetailsFetcher, getEntLocationsByPostcode, getEntLocationsByCity, getUserRecentBoltSearchesFetcher, saveRecentBoltSearchUpdater, getFerryPortsFetcher, getBannerFetcher, updateDOB, updateFlightSeatMapUpdater, deleteAllRecentSearchesUpdater, getOfficeDivisionsFetcher) {
38712
- var _e;
38774
+ var _j;
38713
38775
  var _this = this;
38714
38776
  this.searchAirportsFetcher = searchAirportsFetcher;
38715
38777
  this.searchAirlinesFetcher = searchAirlinesFetcher;
@@ -38834,23 +38896,23 @@
38834
38896
  console.log('Enterpise search service being inited');
38835
38897
  console.log('Newly created search objects: ', this.searches);
38836
38898
  this.search_objects = {};
38837
- this.searches = (_e = {},
38838
- _e[ServiceType.Cab] = null,
38839
- _e[ServiceType.Car] = null,
38840
- _e[ServiceType.Coach] = null,
38841
- _e[ServiceType.Eurostar] = null,
38842
- _e[ServiceType.FastTrack] = null,
38843
- _e[ServiceType.Ferry] = null,
38844
- _e[ServiceType.Flight] = null,
38845
- _e[ServiceType.Hotel] = null,
38846
- _e[ServiceType.InternationalRail] = null,
38847
- _e[ServiceType.Lounge] = null,
38848
- _e[ServiceType.Parking] = null,
38849
- _e[ServiceType.Rail] = null,
38850
- _e[ServiceType.LongStays] = null,
38851
- _e[ServiceType.SeasonTicket] = null,
38852
- _e[ServiceType.MeetingRoom] = null,
38853
- _e);
38899
+ this.searches = (_j = {},
38900
+ _j[ServiceType.Cab] = null,
38901
+ _j[ServiceType.Car] = null,
38902
+ _j[ServiceType.Coach] = null,
38903
+ _j[ServiceType.Eurostar] = null,
38904
+ _j[ServiceType.FastTrack] = null,
38905
+ _j[ServiceType.Ferry] = null,
38906
+ _j[ServiceType.Flight] = null,
38907
+ _j[ServiceType.Hotel] = null,
38908
+ _j[ServiceType.InternationalRail] = null,
38909
+ _j[ServiceType.Lounge] = null,
38910
+ _j[ServiceType.Parking] = null,
38911
+ _j[ServiceType.Rail] = null,
38912
+ _j[ServiceType.LongStays] = null,
38913
+ _j[ServiceType.SeasonTicket] = null,
38914
+ _j[ServiceType.MeetingRoom] = null,
38915
+ _j);
38854
38916
  this.selectedTravellers = this.storageService.getSessionItemAsList(BaseEnterpriseSearchService.SESSION_TRAVELLER);
38855
38917
  this.travellerInformation.next(this.selectedTravellers);
38856
38918
  userService.fullUserDetails.userServices.subscribe(function (services) {
@@ -38923,29 +38985,29 @@
38923
38985
  configurable: true
38924
38986
  });
38925
38987
  BaseEnterpriseSearchService.prototype.createSearchObjects = function (loungeFetcher, helpers, basketService, storageService, userService, parkingFetcher, flightFetcher, applyFlightRules, modalService, hotelFetcher, environment, hotelAvalibilityService, httpCallService, quicklistFetcher, getRailStationFetcher, applyHotelRulesFetcher, carhireFetcher, carHireAvailabilityDetailFetcher, cabhireFetcher, irlFetcher, irlDiscountCardsFetcher, getIrlSupplierStationFetcher, fasttrackFetcher, emailFerryFetcher, railFetcher, eurostarFetcher, getFlightExtrasOptionsFetcher, getRequestedHotelUpdateFetcher, emailApartmentBookingFetcher, emailSeasonTicketFetcher, getFlightSearchExchangeFetcher, getFlightExchangeDetailsFetcher, emailMeetingRoomBookingFetcher, updateFlightSeatMapUpdater) {
38926
- var _e;
38988
+ var _j;
38927
38989
  var searchesAreNull = this.checkIfSearchesAreNull();
38928
38990
  if (!this.search_objects ||
38929
38991
  Object.values(this.search_objects).length === 0 ||
38930
38992
  searchesAreNull) {
38931
38993
  this.search_objects = this.helpers.clone(this.init_search_objects());
38932
- this.searches = (_e = {},
38933
- _e[ServiceType.Lounge] = new LoungesEnterpriseSearch(loungeFetcher, helpers, basketService, storageService, this, userService),
38934
- _e[ServiceType.Parking] = new ParkingEnterpriseSearch(parkingFetcher, helpers, basketService, storageService, this, userService),
38935
- _e[ServiceType.Flight] = new FlightEnterpriseSearch(flightFetcher, helpers, userService, basketService, storageService, this, applyFlightRules, modalService, getFlightExtrasOptionsFetcher, getFlightSearchExchangeFetcher, getFlightExchangeDetailsFetcher, updateFlightSeatMapUpdater),
38936
- _e[ServiceType.Hotel] = new HotelEnterpriseSearch(hotelFetcher, helpers, userService, environment, hotelAvalibilityService, basketService, storageService, this, httpCallService, quicklistFetcher, getRailStationFetcher, applyHotelRulesFetcher, getRequestedHotelUpdateFetcher),
38937
- _e[ServiceType.Car] = new CarhireEnterpriseSearch(carhireFetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, this, userService),
38938
- _e[ServiceType.Cab] = new CabHireEnterpriseSearch(cabhireFetcher, helpers, storageService, this, basketService, userService),
38939
- _e[ServiceType.InternationalRail] = new IRLEnterpriseSearch(irlFetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, this, getIrlSupplierStationFetcher, userService),
38940
- _e[ServiceType.FastTrack] = new FastTrackEnterpriseSearch(fasttrackFetcher, helpers, basketService, storageService, this, userService),
38941
- _e[ServiceType.Coach] = null,
38942
- _e[ServiceType.Ferry] = new FerryEnterpriseSearch(emailFerryFetcher, helpers, basketService, storageService, this, userService),
38943
- _e[ServiceType.Rail] = new RailEnterpriseSearch(railFetcher, getRailStationFetcher, helpers, basketService, storageService, this, userService, modalService),
38944
- _e[ServiceType.Eurostar] = new EurostarEnterpriseSearch(eurostarFetcher, helpers, userService, basketService, storageService, this, modalService, applyFlightRules),
38945
- _e[ServiceType.LongStays] = new ApartmentEnterpriseSearch(emailApartmentBookingFetcher, helpers, basketService, storageService, this, userService),
38946
- _e[ServiceType.SeasonTicket] = new SeasonTicketsEnterpriseSearch(emailSeasonTicketFetcher, helpers, basketService, storageService, this, userService),
38947
- _e[ServiceType.MeetingRoom] = new MeetingRoomEnterpriseSearch(emailMeetingRoomBookingFetcher, helpers, basketService, storageService, this, userService),
38948
- _e);
38994
+ this.searches = (_j = {},
38995
+ _j[ServiceType.Lounge] = new LoungesEnterpriseSearch(loungeFetcher, helpers, basketService, storageService, this, userService),
38996
+ _j[ServiceType.Parking] = new ParkingEnterpriseSearch(parkingFetcher, helpers, basketService, storageService, this, userService),
38997
+ _j[ServiceType.Flight] = new FlightEnterpriseSearch(flightFetcher, helpers, userService, basketService, storageService, this, applyFlightRules, modalService, getFlightExtrasOptionsFetcher, getFlightSearchExchangeFetcher, getFlightExchangeDetailsFetcher, updateFlightSeatMapUpdater),
38998
+ _j[ServiceType.Hotel] = new HotelEnterpriseSearch(hotelFetcher, helpers, userService, environment, hotelAvalibilityService, basketService, storageService, this, httpCallService, quicklistFetcher, getRailStationFetcher, applyHotelRulesFetcher, getRequestedHotelUpdateFetcher),
38999
+ _j[ServiceType.Car] = new CarhireEnterpriseSearch(carhireFetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, this, userService),
39000
+ _j[ServiceType.Cab] = new CabHireEnterpriseSearch(cabhireFetcher, helpers, storageService, this, basketService, userService),
39001
+ _j[ServiceType.InternationalRail] = new IRLEnterpriseSearch(irlFetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, this, getIrlSupplierStationFetcher, userService),
39002
+ _j[ServiceType.FastTrack] = new FastTrackEnterpriseSearch(fasttrackFetcher, helpers, basketService, storageService, this, userService),
39003
+ _j[ServiceType.Coach] = null,
39004
+ _j[ServiceType.Ferry] = new FerryEnterpriseSearch(emailFerryFetcher, helpers, basketService, storageService, this, userService),
39005
+ _j[ServiceType.Rail] = new RailEnterpriseSearch(railFetcher, getRailStationFetcher, helpers, basketService, storageService, this, userService, modalService),
39006
+ _j[ServiceType.Eurostar] = new EurostarEnterpriseSearch(eurostarFetcher, helpers, userService, basketService, storageService, this, modalService, applyFlightRules),
39007
+ _j[ServiceType.LongStays] = new ApartmentEnterpriseSearch(emailApartmentBookingFetcher, helpers, basketService, storageService, this, userService),
39008
+ _j[ServiceType.SeasonTicket] = new SeasonTicketsEnterpriseSearch(emailSeasonTicketFetcher, helpers, basketService, storageService, this, userService),
39009
+ _j[ServiceType.MeetingRoom] = new MeetingRoomEnterpriseSearch(emailMeetingRoomBookingFetcher, helpers, basketService, storageService, this, userService),
39010
+ _j);
38949
39011
  }
38950
39012
  };
38951
39013
  BaseEnterpriseSearchService.prototype.checkIfSearchesAreNull = function () {
@@ -39059,7 +39121,7 @@
39059
39121
  // : airport;
39060
39122
  // })
39061
39123
  .map(function (airport) {
39062
- var _a, _b, _c, _d;
39124
+ var _a, _b, _c, _d, _e, _f, _g, _h;
39063
39125
  return {
39064
39126
  destination: airport.name,
39065
39127
  gateway: airport.iata,
@@ -39067,7 +39129,9 @@
39067
39129
  country: (_a = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _a === void 0 ? void 0 : _a.country,
39068
39130
  postcode: (_b = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _b === void 0 ? void 0 : _b.postcode,
39069
39131
  countryCode: (_c = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _c === void 0 ? void 0 : _c.countryCode,
39070
- locationType: (_d = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _d === void 0 ? void 0 : _d.locationType
39132
+ locationType: (_d = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _d === void 0 ? void 0 : _d.locationType,
39133
+ latitude: (_f = (_e = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _e === void 0 ? void 0 : _e.coordinates) === null || _f === void 0 ? void 0 : _f.latitude,
39134
+ longitude: (_h = (_g = airport === null || airport === void 0 ? void 0 : airport.locationDetails) === null || _g === void 0 ? void 0 : _g.coordinates) === null || _h === void 0 ? void 0 : _h.longitude
39071
39135
  };
39072
39136
  }));
39073
39137
  }
@@ -39109,7 +39173,9 @@
39109
39173
  return {
39110
39174
  name: result.destination,
39111
39175
  type: exports.LocationTypes.Airport,
39112
- airport: result
39176
+ airport: result,
39177
+ latitude: result.latitude,
39178
+ longitude: result.longitude
39113
39179
  };
39114
39180
  });
39115
39181
  };
@@ -39295,13 +39361,16 @@
39295
39361
  return results
39296
39362
  ? results
39297
39363
  .map(function (result) {
39364
+ var _a, _b, _c, _d;
39298
39365
  if (!euOnly ||
39299
39366
  result.locationDetails.countryCode !== 'GB' ||
39300
39367
  result.stationCode === 'STP') {
39301
39368
  return {
39302
39369
  type: exports.LocationTypes.TrainStation,
39303
39370
  name: result.name,
39304
- railstation: result
39371
+ railstation: result,
39372
+ latitude: (_b = (_a = result.locationDetails) === null || _a === void 0 ? void 0 : _a.coordinates) === null || _b === void 0 ? void 0 : _b.latitude,
39373
+ longitude: (_d = (_c = result.locationDetails) === null || _c === void 0 ? void 0 : _c.coordinates) === null || _d === void 0 ? void 0 : _d.longitude
39305
39374
  };
39306
39375
  }
39307
39376
  })
@@ -39555,8 +39624,8 @@
39555
39624
  };
39556
39625
  BaseEnterpriseSearchService.prototype._getHighestSearchPriorityObject = function (basketItems) {
39557
39626
  if (basketItems === void 0) { basketItems = {}; }
39558
- return Object.values(this.search_objects).reduce(function (_e, item) {
39559
- var highest = _e.highest, currentItem = _e.currentItem;
39627
+ return Object.values(this.search_objects).reduce(function (_j, item) {
39628
+ var highest = _j.highest, currentItem = _j.currentItem;
39560
39629
  if (item.chosen && item.priority < highest) {
39561
39630
  if (!basketItems[item.type]) {
39562
39631
  return { highest: item.priority, currentItem: item };
@@ -39632,8 +39701,8 @@
39632
39701
  BaseEnterpriseSearchService.prototype.getAllErrorMessages = function (isFavourite) {
39633
39702
  var _this = this;
39634
39703
  if (isFavourite === void 0) { isFavourite = false; }
39635
- var concattedErrors = Object.entries(this.search_objects).reduce(function (accum, _e) {
39636
- var _f = __read(_e, 2), type = _f[0], searchObject = _f[1];
39704
+ var concattedErrors = Object.entries(this.search_objects).reduce(function (accum, _j) {
39705
+ var _k = __read(_j, 2), type = _k[0], searchObject = _k[1];
39637
39706
  var search = _this.searches[type];
39638
39707
  var messages = search ?
39639
39708
  (!isFavourite ? search.validationMessages : search.validationFavouriteMessages) :
@@ -40035,8 +40104,8 @@
40035
40104
  BaseEnterpriseSearchService.prototype.saveUserAddress = function (formAddress) {
40036
40105
  return __awaiter(this, void 0, void 0, function () {
40037
40106
  var House, Street, Town, PostCode, Country, descArr, description, address, value;
40038
- return __generator(this, function (_e) {
40039
- switch (_e.label) {
40107
+ return __generator(this, function (_j) {
40108
+ switch (_j.label) {
40040
40109
  case 0:
40041
40110
  House = formAddress.House, Street = formAddress.Street, Town = formAddress.Town, PostCode = formAddress.PostCode, Country = formAddress.Country;
40042
40111
  descArr = [];
@@ -40062,7 +40131,7 @@
40062
40131
  if (!address) return [3 /*break*/, 2];
40063
40132
  return [4 /*yield*/, this.saveUserAddressUpdater.updateOne(address).toPromise()];
40064
40133
  case 1:
40065
- value = _e.sent();
40134
+ value = _j.sent();
40066
40135
  return [2 /*return*/, value];
40067
40136
  case 2: return [2 /*return*/];
40068
40137
  }
@@ -40863,11 +40932,11 @@
40863
40932
  };
40864
40933
  BaseEnterpriseSearchService.prototype.simultaneousSearchesCheck = function (ignoreChosen) {
40865
40934
  if (ignoreChosen === void 0) { ignoreChosen = false; }
40866
- var _a, _b, _c, _d;
40935
+ var _a, _b, _c, _d, _e, _f;
40867
40936
  return __awaiter(this, void 0, void 0, function () {
40868
- var search_objects_copy, trainlineConfig, hasTLEnabled;
40869
- return __generator(this, function (_e) {
40870
- switch (_e.label) {
40937
+ var search_objects_copy, trainlineConfig, hasTLEnabled, flightSearchQuery, outCc, inCc, notUKRail;
40938
+ return __generator(this, function (_j) {
40939
+ switch (_j.label) {
40871
40940
  case 0:
40872
40941
  search_objects_copy = this.helpers.clone(this.init_search_objects());
40873
40942
  if (this.userService.canBook(ServiceType.Flight) && this.searches[ServiceType.Flight]) {
@@ -40893,47 +40962,51 @@
40893
40962
  (!this.search_objects[ServiceType.Rail].chosen || ignoreChosen))) return [3 /*break*/, 8];
40894
40963
  trainlineConfig = '';
40895
40964
  hasTLEnabled = this.userService.userHasServiceProvider(ServiceType.Rail, exports.ServiceProvider.Trainline);
40896
- if (!hasTLEnabled) return [3 /*break*/, 2];
40965
+ flightSearchQuery = this.searches[ServiceType.Flight];
40966
+ outCc = (_b = flightSearchQuery.departLocation) === null || _b === void 0 ? void 0 : _b.countryCode;
40967
+ inCc = (_c = flightSearchQuery.arriveLocation) === null || _c === void 0 ? void 0 : _c.countryCode;
40968
+ notUKRail = outCc !== 'GB' && inCc !== 'GB';
40969
+ if (!(hasTLEnabled && notUKRail)) return [3 /*break*/, 2];
40897
40970
  return [4 /*yield*/, this.getTrainlineSearchConfig().toPromise()];
40898
40971
  case 1:
40899
- trainlineConfig = _e.sent();
40900
- _e.label = 2;
40972
+ trainlineConfig = _j.sent();
40973
+ _j.label = 2;
40901
40974
  case 2: return [4 /*yield*/, this.searches[ServiceType.Flight].canBeRailSearched(this.searches[ServiceType.Flight].chosenSearchType, trainlineConfig)];
40902
40975
  case 3:
40903
- if (!_e.sent()) return [3 /*break*/, 8];
40904
- if (!(trainlineConfig && hasTLEnabled)) return [3 /*break*/, 5];
40976
+ if (!_j.sent()) return [3 /*break*/, 8];
40977
+ if (!(trainlineConfig && trainlineConfig !== 'UK_only' && hasTLEnabled)) return [3 /*break*/, 5];
40905
40978
  // do a specific trainline one
40906
- return [4 /*yield*/, this.searches[ServiceType.Rail].generateQueryFromFlightQueryTrainline(this.searches[ServiceType.Flight].getSearchQuery(), this.searches[ServiceType.Flight].outboundSameSearchTrainlineStations, this.searches[ServiceType.Flight].inboundSameSearchTrainlineStations, this.searches[ServiceType.Flight].departLocation, this.searches[ServiceType.Flight].arriveLocation)];
40979
+ return [4 /*yield*/, this.searches[ServiceType.Rail].generateQueryFromFlightQueryTrainline(flightSearchQuery.getSearchQuery(), flightSearchQuery.outboundSameSearchTrainlineStations, flightSearchQuery.inboundSameSearchTrainlineStations, flightSearchQuery.departLocation, flightSearchQuery.arriveLocation)];
40907
40980
  case 4:
40908
40981
  // do a specific trainline one
40909
- _e.sent();
40982
+ _j.sent();
40910
40983
  return [3 /*break*/, 7];
40911
- case 5: return [4 /*yield*/, this.searches[ServiceType.Rail].generateQueryFromFlightQuery(this.searches[ServiceType.Flight].getSearchQuery())];
40984
+ case 5: return [4 /*yield*/, this.searches[ServiceType.Rail].generateQueryFromFlightQuery(flightSearchQuery.getSearchQuery())];
40912
40985
  case 6:
40913
- _e.sent();
40914
- _e.label = 7;
40986
+ _j.sent();
40987
+ _j.label = 7;
40915
40988
  case 7:
40916
40989
  console.log(this.searches[ServiceType.Rail]);
40917
- this.searches[ServiceType.Flight].railFromFlightSearchPerformed = true;
40990
+ flightSearchQuery.railFromFlightSearchPerformed = true;
40918
40991
  this.search_objects[ServiceType.Rail].priority = this.search_objects.FLIGHT.priority;
40919
40992
  this.search_objects[ServiceType.Rail].resultUrl = this.search_objects.FLIGHT.resultUrl;
40920
- _e.label = 8;
40993
+ _j.label = 8;
40921
40994
  case 8:
40922
- if (!(((_b = this.search_objects[ServiceType.Flight]) === null || _b === void 0 ? void 0 : _b.chosen) &&
40995
+ if (!(((_d = this.search_objects[ServiceType.Flight]) === null || _d === void 0 ? void 0 : _d.chosen) &&
40923
40996
  this.userService.canBook(ServiceType.Eurostar) &&
40924
40997
  (!this.search_objects[ServiceType.Eurostar].chosen || ignoreChosen))) return [3 /*break*/, 10];
40925
40998
  if (!this.searches[ServiceType.Flight].canBeEuroSearched()) return [3 /*break*/, 10];
40926
40999
  return [4 /*yield*/, this.searches[ServiceType.Eurostar].generateQueryFromFlightQuery(this.searches[ServiceType.Flight].getSearchQuery(), this.searches[ServiceType.Flight].departLocation.gateway, this.searches[ServiceType.Flight].arriveLocation.gateway)];
40927
41000
  case 9:
40928
- _e.sent();
41001
+ _j.sent();
40929
41002
  this.searches[ServiceType.Flight].eurostarFromFlightSearchPerformed = true;
40930
41003
  this.search_objects[ServiceType.Eurostar].priority = this.search_objects.FLIGHT.priority;
40931
41004
  this.search_objects[ServiceType.Eurostar].resultUrl = this.search_objects.FLIGHT.resultUrl;
40932
- _e.label = 10;
41005
+ _j.label = 10;
40933
41006
  case 10:
40934
- if ((_c = this.search_objects[ServiceType.Flight]) === null || _c === void 0 ? void 0 : _c.chosen) {
41007
+ if ((_e = this.search_objects[ServiceType.Flight]) === null || _e === void 0 ? void 0 : _e.chosen) {
40935
41008
  this.searches[ServiceType.Flight].hotelFromFlightSearchPerformed =
40936
- (_d = this.search_objects[ServiceType.Hotel]) === null || _d === void 0 ? void 0 : _d.chosen;
41009
+ (_f = this.search_objects[ServiceType.Hotel]) === null || _f === void 0 ? void 0 : _f.chosen;
40937
41010
  }
40938
41011
  return [2 /*return*/];
40939
41012
  }
@@ -43970,6 +44043,7 @@
43970
44043
  exports.makeDraftManagamentInfo = makeDraftManagamentInfo;
43971
44044
  exports.makeManagamentInfo = makeManagamentInfo;
43972
44045
  exports.maxTravellerWellbeing = maxTravellerWellbeing;
44046
+ exports.nonEnterpriseCarServices = nonEnterpriseCarServices;
43973
44047
  exports["ɵ0"] = ɵ0;
43974
44048
  exports["ɵk"] = FetchableList;
43975
44049
  exports["ɵl"] = FetchableObject;