@qite/tide-booking-component 1.4.113 → 1.4.115

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/index.js +219 -130
  2. package/build/build-cjs/src/search-results/components/book-packaging-entry/index.d.ts +1 -0
  3. package/build/build-cjs/src/search-results/components/book-packaging-entry/wl-sidebar.d.ts +2 -0
  4. package/build/build-cjs/src/search-results/types.d.ts +1 -0
  5. package/build/build-cjs/src/shared/utils/booking-summary.d.ts +1 -0
  6. package/build/build-esm/index.js +219 -130
  7. package/build/build-esm/src/search-results/components/book-packaging-entry/index.d.ts +1 -0
  8. package/build/build-esm/src/search-results/components/book-packaging-entry/wl-sidebar.d.ts +2 -0
  9. package/build/build-esm/src/search-results/types.d.ts +1 -0
  10. package/build/build-esm/src/shared/utils/booking-summary.d.ts +1 -0
  11. package/package.json +1 -1
  12. package/src/search-results/components/book-packaging-entry/index.tsx +27 -7
  13. package/src/search-results/components/book-packaging-entry/wl-sidebar.tsx +27 -16
  14. package/src/search-results/components/flight/flight-selection/independent-flight-selection.tsx +5 -2
  15. package/src/search-results/components/hotel/hotel-accommodation-results.tsx +11 -2
  16. package/src/search-results/components/search-results-container/search-results-container.tsx +5 -1
  17. package/src/search-results/types.ts +1 -0
  18. package/src/shared/booking/summary.tsx +0 -1
  19. package/src/shared/components/flyin/flights-flyin.tsx +5 -2
  20. package/src/shared/components/flyin/flyin.tsx +10 -1
  21. package/src/shared/utils/booking-summary.tsx +11 -0
  22. package/src/shared/utils/tide-api-utils.ts +2 -2
  23. package/styles/components/_select-wrapper.scss +5 -0
@@ -13855,8 +13855,8 @@ PERFORMANCE OF THIS SOFTWARE.
13855
13855
  })(build);
13856
13856
 
13857
13857
  var tideConnection = {
13858
- // host: 'https://localhost:44341',
13859
- host: 'https://preview-tide.tidesoftware.be',
13858
+ host: 'https://localhost:44341',
13859
+ // host: 'https://preview-tide.tidesoftware.be',
13860
13860
  apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
13861
13861
  catalogueIds: [1],
13862
13862
  officeId: 1
@@ -35722,10 +35722,13 @@ var FlightsFlyIn = function (_a) {
35722
35722
  return Math.round(combo.price - selectedCombinationFlight.price);
35723
35723
  };
35724
35724
  // TODO: go to booking page?
35725
- var handleConfirm = function () {
35725
+ var onHandleConfirm = function () {
35726
35726
  if (isOpen) {
35727
35727
  onCancelSearch();
35728
35728
  setIsOpen(false);
35729
+ if ((context === null || context === void 0 ? void 0 : context.onFlightBook) && selectedCombinationFlight) {
35730
+ context.onFlightBook(selectedCombinationFlight);
35731
+ }
35729
35732
  }
35730
35733
  };
35731
35734
  return React__default['default'].createElement(
@@ -36342,7 +36345,7 @@ var FlightsFlyIn = function (_a) {
36342
36345
  React__default['default'].createElement(
36343
36346
  'div',
36344
36347
  { className: 'flyin__button-wrapper' },
36345
- React__default['default'].createElement('button', { className: 'cta cta--select', onClick: handleConfirm }, translations.PRODUCT.BOOK_NOW)
36348
+ React__default['default'].createElement('button', { className: 'cta cta--select', onClick: onHandleConfirm }, translations.PRODUCT.BOOK_NOW)
36346
36349
  )
36347
36350
  )
36348
36351
  );
@@ -41588,11 +41591,20 @@ var HotelAccommodationResults = function (_a) {
41588
41591
  function () {
41589
41592
  var shouldShowAll =
41590
41593
  (context === null || context === void 0 ? void 0 : context.searchConfiguration.qsmType) !== build.PortalQsmType.AccommodationAndFlight || isFlyIn;
41594
+ var filteredMapperResults = mappedResults;
41595
+ if (selectedPackagingAccoResult) {
41596
+ filteredMapperResults = mappedResults.filter(function (result) {
41597
+ return result.code !== selectedPackagingAccoResult.code;
41598
+ });
41599
+ }
41591
41600
  if (shouldShowAll) {
41592
- return mappedResults;
41601
+ if (isFlyIn) {
41602
+ return mappedResults;
41603
+ }
41604
+ return filteredMapperResults;
41593
41605
  }
41594
41606
  if (selectedPackagingAccoResult) {
41595
- return mappedResults
41607
+ return filteredMapperResults
41596
41608
  .filter(function (result) {
41597
41609
  return result.code !== selectedPackagingAccoResult.code;
41598
41610
  })
@@ -43196,6 +43208,13 @@ var FlyIn = function (_a) {
43196
43208
  dispatch(setSortType(newSortByType));
43197
43209
  }
43198
43210
  };
43211
+ var onHandleConfirm = function () {
43212
+ if (context === null || context === void 0 ? void 0 : context.packagingEntry) {
43213
+ handleConfirm === null || handleConfirm === void 0 ? void 0 : handleConfirm();
43214
+ } else {
43215
+ dispatch(setBookPackagingEntry(true));
43216
+ }
43217
+ };
43199
43218
  return React__default['default'].createElement(
43200
43219
  'div',
43201
43220
  {
@@ -43333,7 +43352,7 @@ var FlyIn = function (_a) {
43333
43352
  ),
43334
43353
  (srpType === build.PortalQsmType.Accommodation || srpType === build.PortalQsmType.AccommodationAndFlight) &&
43335
43354
  flyInType === 'acco-details' &&
43336
- React__default['default'].createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: handleConfirm }),
43355
+ React__default['default'].createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: onHandleConfirm }),
43337
43356
  srpType === build.PortalQsmType.AccommodationAndFlight &&
43338
43357
  (flyInType === 'flight-outward-results' || flyInType === 'flight-return-results') &&
43339
43358
  React__default['default'].createElement(PackageingFlightsFlyIn, {
@@ -44212,8 +44231,11 @@ var IndependentFlightSelection = function (_a) {
44212
44231
  [searchResults, selectedReturnKey]
44213
44232
  );
44214
44233
  var firstResultDate = uniqueOutwardFlights.length > 0 ? uniqueOutwardFlights[0].outward.segments[0].departureDateTime : null;
44234
+ var firstResultReturnDate = uniqueReturnFlights.length > 0 ? uniqueReturnFlights[0].return.segments[0].departureDateTime : null;
44215
44235
  var firstResultDay = firstResultDate ? dateFns.format(firstResultDate, 'd') : null;
44216
44236
  var firstResultMonth = firstResultDate ? dateFns.format(firstResultDate, 'MMM') : null;
44237
+ var firstResultReturnDay = firstResultReturnDate ? dateFns.format(firstResultReturnDate, 'd') : null;
44238
+ var firstResultReturnMonth = firstResultReturnDate ? dateFns.format(firstResultReturnDate, 'MMM') : null;
44217
44239
  return React__default['default'].createElement(
44218
44240
  React__default['default'].Fragment,
44219
44241
  null,
@@ -44268,7 +44290,12 @@ var IndependentFlightSelection = function (_a) {
44268
44290
  React__default['default'].createElement(
44269
44291
  'div',
44270
44292
  { className: 'search__results__label search__results__label--secondary' },
44271
- React__default['default'].createElement('div', { className: 'search__results__label__date' }),
44293
+ React__default['default'].createElement(
44294
+ 'div',
44295
+ { className: 'search__results__label__date' },
44296
+ React__default['default'].createElement('p', { className: 'search__results__label__date-date' }, firstResultReturnDay),
44297
+ React__default['default'].createElement('p', null, firstResultReturnMonth)
44298
+ ),
44272
44299
  React__default['default'].createElement(
44273
44300
  'div',
44274
44301
  { className: 'search__results__label__text' },
@@ -46736,6 +46763,83 @@ var DayByDayExcursions = function () {
46736
46763
  );
46737
46764
  };
46738
46765
 
46766
+ var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
46767
+ var _a, _b;
46768
+ var priceDetailsByProduct = lodash.groupBy(
46769
+ (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
46770
+ function (detail) {
46771
+ return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
46772
+ }
46773
+ );
46774
+ return (
46775
+ (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
46776
+ ).map(function (line) {
46777
+ var _a, _b, _c;
46778
+ var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
46779
+ var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
46780
+ return detail.showPrice || detail.isSeparate;
46781
+ });
46782
+ return React__default['default'].createElement(
46783
+ 'li',
46784
+ { key: line.guid },
46785
+ React__default['default'].createElement('h6', null, line.productName),
46786
+ React__default['default'].createElement(
46787
+ 'ul',
46788
+ null,
46789
+ React__default['default'].createElement('li', { className: 'list__item' }, lodash.compact([line.accommodationName, line.regimeName]).join(', ')),
46790
+ (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
46791
+ ? void 0
46792
+ : _c.map(function (flightLine, index) {
46793
+ var _a, _b;
46794
+ return React__default['default'].createElement(
46795
+ 'li',
46796
+ { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
46797
+ flightLine.departureAirportCode,
46798
+ ' ',
46799
+ (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
46800
+ ' > ',
46801
+ flightLine.arrivalAirportCode,
46802
+ ' ',
46803
+ (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
46804
+ ' (',
46805
+ flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
46806
+ ')'
46807
+ );
46808
+ }),
46809
+ !lodash.isEmpty(visiblePriceDetails) &&
46810
+ visiblePriceDetails.map(function (detail, index) {
46811
+ var _a;
46812
+ return React__default['default'].createElement(
46813
+ 'li',
46814
+ { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
46815
+ detail.priceDescription,
46816
+ ': ',
46817
+ (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
46818
+ );
46819
+ })
46820
+ ),
46821
+ React__default['default'].createElement(
46822
+ 'p',
46823
+ null,
46824
+ '(',
46825
+ line.from === line.to
46826
+ ? getDateText(line.from)
46827
+ : React__default['default'].createElement(React__default['default'].Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
46828
+ ')'
46829
+ )
46830
+ );
46831
+ });
46832
+ };
46833
+ var getImageSrcFromHtml = function (html) {
46834
+ var _a;
46835
+ if (!html || typeof window === 'undefined') {
46836
+ return undefined;
46837
+ }
46838
+ var doc = new DOMParser().parseFromString(html, 'text/html');
46839
+ var img = doc.querySelector('img');
46840
+ return (_a = img === null || img === void 0 ? void 0 : img.getAttribute('src')) !== null && _a !== void 0 ? _a : undefined;
46841
+ };
46842
+
46739
46843
  var mapToSidebarFlightMetaData = function (entryLine) {
46740
46844
  var _a, _b;
46741
46845
  return {
@@ -46795,22 +46899,16 @@ var selectSeparatePackagePriceDetails = function (priceDetails) {
46795
46899
  return result;
46796
46900
  };
46797
46901
  var WLSidebar = function (_a) {
46798
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
46799
- var activeSearchSeed = _a.activeSearchSeed;
46902
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
46903
+ var activeSearchSeed = _a.activeSearchSeed,
46904
+ packagingAccoResult = _a.packagingAccoResult;
46800
46905
  var context = React.useContext(SearchResultsConfigurationContext);
46801
- if (!context) {
46802
- return null;
46803
- }
46804
- var translations = getTranslations((_b = context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46805
- var _u = reactRedux.useSelector(function (state) {
46906
+ var _4 = reactRedux.useSelector(function (state) {
46806
46907
  return state.searchResults;
46807
46908
  }),
46808
- editablePackagingEntry = _u.editablePackagingEntry,
46809
- priceDetails = _u.priceDetails;
46810
- // Map editablePackagingEntry to sidebar props (example, adjust as needed)
46811
- if (!editablePackagingEntry) {
46812
- return null;
46813
- }
46909
+ editablePackagingEntry = _4.editablePackagingEntry,
46910
+ priceDetails = _4.priceDetails;
46911
+ var translations = getTranslations((_b = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46814
46912
  var sortedLines = React.useMemo(
46815
46913
  function () {
46816
46914
  var _a;
@@ -46830,35 +46928,70 @@ var WLSidebar = function (_a) {
46830
46928
  },
46831
46929
  [editablePackagingEntry]
46832
46930
  );
46931
+ var accoImage = React.useMemo(
46932
+ function () {
46933
+ return getImageSrcFromHtml(packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.contents);
46934
+ },
46935
+ [packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.contents]
46936
+ );
46937
+ if (!context || !editablePackagingEntry) {
46938
+ return null;
46939
+ }
46833
46940
  var firstEntryLine = lodash.first(sortedLines);
46834
46941
  var accommodationLines = editablePackagingEntry.lines.filter(function (line) {
46835
46942
  return line.serviceType === ACCOMMODATION_SERVICE_TYPE;
46836
46943
  });
46837
46944
  var accommodationLine = (_c = lodash.first(accommodationLines)) !== null && _c !== void 0 ? _c : firstEntryLine;
46838
46945
  var location =
46839
- (_l =
46840
- (_j =
46841
- (_g =
46842
- (_e =
46843
- (_d = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _d === void 0
46946
+ context.searchConfiguration.qsmType === build.PortalQsmType.Accommodation
46947
+ ? (_m =
46948
+ (_k =
46949
+ (_h =
46950
+ (_f =
46951
+ (_d = packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.name) !== null && _d !== void 0
46952
+ ? _d
46953
+ : (_e = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _e === void 0
46954
+ ? void 0
46955
+ : _e.name) !== null && _f !== void 0
46956
+ ? _f
46957
+ : (_g = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _g === void 0
46958
+ ? void 0
46959
+ : _g.name) !== null && _h !== void 0
46960
+ ? _h
46961
+ : (_j = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _j === void 0
46844
46962
  ? void 0
46845
- : _d.name) !== null && _e !== void 0
46846
- ? _e
46847
- : (_f = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _f === void 0
46963
+ : _j.name) !== null && _k !== void 0
46964
+ ? _k
46965
+ : (_l = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _l === void 0
46848
46966
  ? void 0
46849
- : _f.name) !== null && _g !== void 0
46850
- ? _g
46851
- : (_h = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _h === void 0
46852
- ? void 0
46853
- : _h.name) !== null && _j !== void 0
46854
- ? _j
46855
- : (_k = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _k === void 0
46967
+ : _l.name) !== null && _m !== void 0
46968
+ ? _m
46969
+ : (_o = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _o === void 0
46856
46970
  ? void 0
46857
- : _k.name) !== null && _l !== void 0
46858
- ? _l
46859
- : (_m = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _m === void 0
46971
+ : _o.name
46972
+ : (_w =
46973
+ (_u =
46974
+ (_s =
46975
+ (_q =
46976
+ (_p = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _p === void 0
46977
+ ? void 0
46978
+ : _p.name) !== null && _q !== void 0
46979
+ ? _q
46980
+ : (_r = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _r === void 0
46981
+ ? void 0
46982
+ : _r.name) !== null && _s !== void 0
46983
+ ? _s
46984
+ : (_t = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _t === void 0
46985
+ ? void 0
46986
+ : _t.name) !== null && _u !== void 0
46987
+ ? _u
46988
+ : (_v = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _v === void 0
46989
+ ? void 0
46990
+ : _v.name) !== null && _w !== void 0
46991
+ ? _w
46992
+ : (_x = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _x === void 0
46860
46993
  ? void 0
46861
- : _m.name;
46994
+ : _x.name;
46862
46995
  var rooms =
46863
46996
  (activeSearchSeed === null || activeSearchSeed === void 0
46864
46997
  ? void 0
@@ -46888,7 +47021,7 @@ var WLSidebar = function (_a) {
46888
47021
  var outboundFlightMetaData = outboundFlight ? mapToSidebarFlightMetaData(outboundFlight) : undefined;
46889
47022
  var returnFlightMetaData = returnFlight ? mapToSidebarFlightMetaData(returnFlight) : undefined;
46890
47023
  var basePrice = lodash.sum(
46891
- (_o =
47024
+ (_y =
46892
47025
  priceDetails === null || priceDetails === void 0
46893
47026
  ? void 0
46894
47027
  : priceDetails.details
@@ -46897,18 +47030,18 @@ var WLSidebar = function (_a) {
46897
47030
  })
46898
47031
  .map(function (pd) {
46899
47032
  return pd.price * pd.amount;
46900
- })) !== null && _o !== void 0
46901
- ? _o
47033
+ })) !== null && _y !== void 0
47034
+ ? _y
46902
47035
  : []
46903
47036
  );
46904
47037
  var separateExtraPriceDetails =
46905
- (_p =
47038
+ (_z =
46906
47039
  priceDetails === null || priceDetails === void 0
46907
47040
  ? void 0
46908
47041
  : priceDetails.details.filter(function (pd) {
46909
47042
  return !pd.isInPackage && pd.isSeparate;
46910
- })) !== null && _p !== void 0
46911
- ? _p
47043
+ })) !== null && _z !== void 0
47044
+ ? _z
46912
47045
  : [];
46913
47046
  var totalPrice = lodash.sum(
46914
47047
  __spreadArray(
@@ -46920,22 +47053,22 @@ var WLSidebar = function (_a) {
46920
47053
  )
46921
47054
  );
46922
47055
  var includedCosts = selectSeparatePackagePriceDetails(
46923
- (_q =
47056
+ (_0 =
46924
47057
  priceDetails === null || priceDetails === void 0
46925
47058
  ? void 0
46926
47059
  : priceDetails.details.filter(function (pd) {
46927
47060
  return pd.isInPackage;
46928
- })) !== null && _q !== void 0
46929
- ? _q
47061
+ })) !== null && _0 !== void 0
47062
+ ? _0
46930
47063
  : []
46931
47064
  );
46932
47065
  return React__default['default'].createElement(SharedSidebar, {
46933
47066
  productName: location !== null && location !== void 0 ? location : '',
46934
- thumbnailUrl: (_r = context.destinationImage) === null || _r === void 0 ? void 0 : _r.url,
47067
+ thumbnailUrl: accoImage !== null && accoImage !== void 0 ? accoImage : (_1 = context.destinationImage) === null || _1 === void 0 ? void 0 : _1.url,
46935
47068
  translations: translations,
46936
47069
  travelerRooms: travelerRooms,
46937
- startDateText: ((_s = lodash.first(sortedLines)) === null || _s === void 0 ? void 0 : _s.from) && formatDate(new Date(lodash.first(sortedLines).from)),
46938
- endDateText: ((_t = lodash.last(sortedLines)) === null || _t === void 0 ? void 0 : _t.to) && formatDate(new Date(lodash.last(sortedLines).to)),
47070
+ startDateText: ((_2 = lodash.first(sortedLines)) === null || _2 === void 0 ? void 0 : _2.from) && formatDate(new Date(lodash.first(sortedLines).from)),
47071
+ endDateText: ((_3 = lodash.last(sortedLines)) === null || _3 === void 0 ? void 0 : _3.to) && formatDate(new Date(lodash.last(sortedLines).to)),
46939
47072
  isLoading: !editablePackagingEntry || !priceDetails,
46940
47073
  loaderComponent: React__default['default'].createElement(Spinner, null),
46941
47074
  departureFlightMetaData: outboundFlightMetaData,
@@ -47461,74 +47594,6 @@ var SharedSummary = function (_a) {
47461
47594
  );
47462
47595
  };
47463
47596
 
47464
- var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
47465
- var _a, _b;
47466
- var priceDetailsByProduct = lodash.groupBy(
47467
- (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
47468
- function (detail) {
47469
- return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
47470
- }
47471
- );
47472
- return (
47473
- (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
47474
- ).map(function (line) {
47475
- var _a, _b, _c;
47476
- var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
47477
- var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
47478
- return detail.showPrice || detail.isSeparate;
47479
- });
47480
- return React__default['default'].createElement(
47481
- 'li',
47482
- { key: line.guid },
47483
- React__default['default'].createElement('h6', null, line.productName),
47484
- React__default['default'].createElement(
47485
- 'ul',
47486
- null,
47487
- React__default['default'].createElement('li', { className: 'list__item' }, lodash.compact([line.accommodationName, line.regimeName]).join(', ')),
47488
- (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
47489
- ? void 0
47490
- : _c.map(function (flightLine, index) {
47491
- var _a, _b;
47492
- return React__default['default'].createElement(
47493
- 'li',
47494
- { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
47495
- flightLine.departureAirportCode,
47496
- ' ',
47497
- (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
47498
- ' > ',
47499
- flightLine.arrivalAirportCode,
47500
- ' ',
47501
- (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
47502
- ' (',
47503
- flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
47504
- ')'
47505
- );
47506
- }),
47507
- !lodash.isEmpty(visiblePriceDetails) &&
47508
- visiblePriceDetails.map(function (detail, index) {
47509
- var _a;
47510
- return React__default['default'].createElement(
47511
- 'li',
47512
- { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
47513
- detail.priceDescription,
47514
- ': ',
47515
- (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
47516
- );
47517
- })
47518
- ),
47519
- React__default['default'].createElement(
47520
- 'p',
47521
- null,
47522
- '(',
47523
- line.from === line.to
47524
- ? getDateText(line.from)
47525
- : React__default['default'].createElement(React__default['default'].Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
47526
- ')'
47527
- )
47528
- );
47529
- });
47530
- };
47531
-
47532
47597
  var travelerFormFields = [{ type: 'gender' }, { type: 'firstName' }, { type: 'lastName' }, { type: 'birthDate' }];
47533
47598
  var mainBookerFormFields = [
47534
47599
  { type: 'street' },
@@ -47552,6 +47617,7 @@ var travellersSettings = {
47552
47617
  var BookPackagingEntry = function (_a) {
47553
47618
  var _b;
47554
47619
  var activeSearchSeed = _a.activeSearchSeed,
47620
+ isLoading = _a.isLoading,
47555
47621
  isConfirmationPage = _a.isConfirmationPage;
47556
47622
  var context = React.useContext(SearchResultsConfigurationContext);
47557
47623
  var dispatch = reactRedux.useDispatch();
@@ -47561,7 +47627,9 @@ var BookPackagingEntry = function (_a) {
47561
47627
  editablePackagingEntry = _c.editablePackagingEntry,
47562
47628
  priceDetails = _c.priceDetails,
47563
47629
  currentStep = _c.currentStep,
47564
- bookingNumber = _c.bookingNumber;
47630
+ bookingNumber = _c.bookingNumber,
47631
+ selectedPackagingAccoResultCode = _c.selectedPackagingAccoResultCode,
47632
+ packagingAccoResults = _c.packagingAccoResults;
47565
47633
  var _d = React.useState([]),
47566
47634
  countries = _d[0],
47567
47635
  setCountries = _d[1];
@@ -47574,6 +47642,9 @@ var BookPackagingEntry = function (_a) {
47574
47642
  var _g = React.useState(false),
47575
47643
  isSubmitting = _g[0],
47576
47644
  setIsSubmitting = _g[1];
47645
+ var _h = React.useState(null),
47646
+ selectedPackagingAccoResult = _h[0],
47647
+ setSelectedPackagingAccoResult = _h[1];
47577
47648
  var translations = React.useMemo(
47578
47649
  function () {
47579
47650
  var _a;
@@ -47652,7 +47723,22 @@ var BookPackagingEntry = function (_a) {
47652
47723
  },
47653
47724
  [isConfirmationPage, dispatch]
47654
47725
  );
47655
- if (!context || !editablePackagingEntry || !priceDetails || !config) return null;
47726
+ React.useEffect(
47727
+ function () {
47728
+ var selectedPackagingAccoResult =
47729
+ packagingAccoResults === null || packagingAccoResults === void 0
47730
+ ? void 0
47731
+ : packagingAccoResults.find(function (result) {
47732
+ return result.code === selectedPackagingAccoResultCode;
47733
+ });
47734
+ if (selectedPackagingAccoResult) {
47735
+ setSelectedPackagingAccoResult(selectedPackagingAccoResult);
47736
+ }
47737
+ },
47738
+ [selectedPackagingAccoResultCode, packagingAccoResults]
47739
+ );
47740
+ if (!context || !editablePackagingEntry || !priceDetails || !config)
47741
+ return React__default['default'].createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING });
47656
47742
  var handleSummarySubmit = function (e) {
47657
47743
  return __awaiter(void 0, void 0, void 0, function () {
47658
47744
  var updatedEditablePackagingEntry, redirectUrl, request, bookingResponse;
@@ -47678,7 +47764,7 @@ var BookPackagingEntry = function (_a) {
47678
47764
  dispatch(setEditablePackagingEntry(updatedEditablePackagingEntry));
47679
47765
  _c.label = 1;
47680
47766
  case 1:
47681
- _c.trys.push([1, 3, 4, 5]);
47767
+ _c.trys.push([1, 3, , 4]);
47682
47768
  request = {
47683
47769
  language: (_a = context.languageCode) !== null && _a !== void 0 ? _a : 'en-GB',
47684
47770
  officeId: context.tideConnection.officeId,
@@ -47694,16 +47780,14 @@ var BookPackagingEntry = function (_a) {
47694
47780
  window.location.href = bookingResponse.paymentUrl;
47695
47781
  } else {
47696
47782
  dispatch(setCurrentStep(2));
47783
+ setIsSubmitting(false);
47697
47784
  }
47698
- return [3 /*break*/, 5];
47785
+ return [3 /*break*/, 4];
47699
47786
  case 3:
47700
47787
  _c.sent();
47701
47788
  dispatch(setCurrentStep(3));
47702
- return [3 /*break*/, 5];
47789
+ return [3 /*break*/, 4];
47703
47790
  case 4:
47704
- setIsSubmitting(false);
47705
- return [7 /*endfinally*/];
47706
- case 5:
47707
47791
  return [2 /*return*/];
47708
47792
  }
47709
47793
  });
@@ -47728,6 +47812,7 @@ var BookPackagingEntry = function (_a) {
47728
47812
  return React__default['default'].createElement(React__default['default'].Fragment, null, step + 1, '.\u00A0', stepLabels[step]);
47729
47813
  }
47730
47814
  },
47815
+ isConfirmationPage && isLoading && React__default['default'].createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING }),
47731
47816
  currentStep === 0 &&
47732
47817
  React__default['default'].createElement(SharedTravelersForm, {
47733
47818
  formik: formik$1,
@@ -47790,7 +47875,7 @@ var BookPackagingEntry = function (_a) {
47790
47875
  )
47791
47876
  ),
47792
47877
  React__default['default'].createElement('div', { className: 'backdrop', id: 'backdrop' }),
47793
- React__default['default'].createElement(WLSidebar, { activeSearchSeed: activeSearchSeed })
47878
+ React__default['default'].createElement(WLSidebar, { activeSearchSeed: activeSearchSeed, packagingAccoResult: selectedPackagingAccoResult })
47794
47879
  )
47795
47880
  );
47796
47881
  };
@@ -49371,7 +49456,11 @@ var SearchResultsContainer = function (_a) {
49371
49456
  'div',
49372
49457
  { className: 'search' },
49373
49458
  bookPackagingEntry
49374
- ? React__default['default'].createElement(BookPackagingEntry, { activeSearchSeed: activeSearchSeed, isConfirmationPage: isBookingConfirmation })
49459
+ ? React__default['default'].createElement(BookPackagingEntry, {
49460
+ activeSearchSeed: activeSearchSeed,
49461
+ isLoading: itineraryIsLoading || pricesAreLoading,
49462
+ isConfirmationPage: isBookingConfirmation
49463
+ })
49375
49464
  : React__default['default'].createElement(
49376
49465
  'div',
49377
49466
  { className: 'search__container' },
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { SearchSeed } from '../../types';
3
3
  interface BookPackagingEntryProps {
4
4
  activeSearchSeed: SearchSeed | null;
5
+ isLoading: boolean;
5
6
  isConfirmationPage?: boolean;
6
7
  }
7
8
  declare const BookPackagingEntry: React.FC<BookPackagingEntryProps>;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { SearchSeed } from '../../types';
3
+ import { PackagingAccommodationResponse } from '@qite/tide-client';
3
4
  interface WLSidebarProps {
4
5
  activeSearchSeed: SearchSeed | null;
6
+ packagingAccoResult: PackagingAccommodationResponse | null;
5
7
  }
6
8
  declare const WLSidebar: React.FC<WLSidebarProps>;
7
9
  export default WLSidebar;
@@ -43,6 +43,7 @@ export interface SearchResultsConfiguration {
43
43
  alt: string;
44
44
  };
45
45
  onBook?: (result: BookingPackage) => void;
46
+ onFlightBook?: (result: ExtendedFlightSearchResponseItem) => void;
46
47
  packagingEntry?: PackagingEntry | null;
47
48
  generatePaymentUrl?: boolean;
48
49
  entryStatus?: number;
@@ -1 +1,2 @@
1
1
  export declare const renderEditablePackagingEntrySummaryOptions: (editablePackagingEntry: any, priceDetails: any, translations: any) => any;
2
+ export declare const getImageSrcFromHtml: (html?: string | null) => string | undefined;