@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
@@ -13887,8 +13887,8 @@ PERFORMANCE OF THIS SOFTWARE.
13887
13887
  })(build);
13888
13888
 
13889
13889
  var tideConnection = {
13890
- // host: 'https://localhost:44341',
13891
- host: 'https://preview-tide.tidesoftware.be',
13890
+ host: 'https://localhost:44341',
13891
+ // host: 'https://preview-tide.tidesoftware.be',
13892
13892
  apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
13893
13893
  catalogueIds: [1],
13894
13894
  officeId: 1
@@ -35607,10 +35607,13 @@ var FlightsFlyIn = function (_a) {
35607
35607
  return Math.round(combo.price - selectedCombinationFlight.price);
35608
35608
  };
35609
35609
  // TODO: go to booking page?
35610
- var handleConfirm = function () {
35610
+ var onHandleConfirm = function () {
35611
35611
  if (isOpen) {
35612
35612
  onCancelSearch();
35613
35613
  setIsOpen(false);
35614
+ if ((context === null || context === void 0 ? void 0 : context.onFlightBook) && selectedCombinationFlight) {
35615
+ context.onFlightBook(selectedCombinationFlight);
35616
+ }
35614
35617
  }
35615
35618
  };
35616
35619
  return React__default.createElement(
@@ -36207,7 +36210,7 @@ var FlightsFlyIn = function (_a) {
36207
36210
  React__default.createElement(
36208
36211
  'div',
36209
36212
  { className: 'flyin__button-wrapper' },
36210
- React__default.createElement('button', { className: 'cta cta--select', onClick: handleConfirm }, translations.PRODUCT.BOOK_NOW)
36213
+ React__default.createElement('button', { className: 'cta cta--select', onClick: onHandleConfirm }, translations.PRODUCT.BOOK_NOW)
36211
36214
  )
36212
36215
  )
36213
36216
  );
@@ -41445,11 +41448,20 @@ var HotelAccommodationResults = function (_a) {
41445
41448
  function () {
41446
41449
  var shouldShowAll =
41447
41450
  (context === null || context === void 0 ? void 0 : context.searchConfiguration.qsmType) !== build.PortalQsmType.AccommodationAndFlight || isFlyIn;
41451
+ var filteredMapperResults = mappedResults;
41452
+ if (selectedPackagingAccoResult) {
41453
+ filteredMapperResults = mappedResults.filter(function (result) {
41454
+ return result.code !== selectedPackagingAccoResult.code;
41455
+ });
41456
+ }
41448
41457
  if (shouldShowAll) {
41449
- return mappedResults;
41458
+ if (isFlyIn) {
41459
+ return mappedResults;
41460
+ }
41461
+ return filteredMapperResults;
41450
41462
  }
41451
41463
  if (selectedPackagingAccoResult) {
41452
- return mappedResults
41464
+ return filteredMapperResults
41453
41465
  .filter(function (result) {
41454
41466
  return result.code !== selectedPackagingAccoResult.code;
41455
41467
  })
@@ -43029,6 +43041,13 @@ var FlyIn = function (_a) {
43029
43041
  dispatch(setSortType(newSortByType));
43030
43042
  }
43031
43043
  };
43044
+ var onHandleConfirm = function () {
43045
+ if (context === null || context === void 0 ? void 0 : context.packagingEntry) {
43046
+ handleConfirm === null || handleConfirm === void 0 ? void 0 : handleConfirm();
43047
+ } else {
43048
+ dispatch(setBookPackagingEntry(true));
43049
+ }
43050
+ };
43032
43051
  return React__default.createElement(
43033
43052
  'div',
43034
43053
  {
@@ -43166,7 +43185,7 @@ var FlyIn = function (_a) {
43166
43185
  ),
43167
43186
  (srpType === build.PortalQsmType.Accommodation || srpType === build.PortalQsmType.AccommodationAndFlight) &&
43168
43187
  flyInType === 'acco-details' &&
43169
- React__default.createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: handleConfirm }),
43188
+ React__default.createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: onHandleConfirm }),
43170
43189
  srpType === build.PortalQsmType.AccommodationAndFlight &&
43171
43190
  (flyInType === 'flight-outward-results' || flyInType === 'flight-return-results') &&
43172
43191
  React__default.createElement(PackageingFlightsFlyIn, { isOpen: isOpen, setIsOpen: setIsOpen, toggleFilters: toggleFilters, filtersOpen: filtersOpen }),
@@ -44004,8 +44023,11 @@ var IndependentFlightSelection = function (_a) {
44004
44023
  [searchResults, selectedReturnKey]
44005
44024
  );
44006
44025
  var firstResultDate = uniqueOutwardFlights.length > 0 ? uniqueOutwardFlights[0].outward.segments[0].departureDateTime : null;
44026
+ var firstResultReturnDate = uniqueReturnFlights.length > 0 ? uniqueReturnFlights[0].return.segments[0].departureDateTime : null;
44007
44027
  var firstResultDay = firstResultDate ? format$2(firstResultDate, 'd') : null;
44008
44028
  var firstResultMonth = firstResultDate ? format$2(firstResultDate, 'MMM') : null;
44029
+ var firstResultReturnDay = firstResultReturnDate ? format$2(firstResultReturnDate, 'd') : null;
44030
+ var firstResultReturnMonth = firstResultReturnDate ? format$2(firstResultReturnDate, 'MMM') : null;
44009
44031
  return React__default.createElement(
44010
44032
  React__default.Fragment,
44011
44033
  null,
@@ -44054,7 +44076,12 @@ var IndependentFlightSelection = function (_a) {
44054
44076
  React__default.createElement(
44055
44077
  'div',
44056
44078
  { className: 'search__results__label search__results__label--secondary' },
44057
- React__default.createElement('div', { className: 'search__results__label__date' }),
44079
+ React__default.createElement(
44080
+ 'div',
44081
+ { className: 'search__results__label__date' },
44082
+ React__default.createElement('p', { className: 'search__results__label__date-date' }, firstResultReturnDay),
44083
+ React__default.createElement('p', null, firstResultReturnMonth)
44084
+ ),
44058
44085
  React__default.createElement(
44059
44086
  'div',
44060
44087
  { className: 'search__results__label__text' },
@@ -46510,6 +46537,83 @@ var DayByDayExcursions = function () {
46510
46537
  );
46511
46538
  };
46512
46539
 
46540
+ var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
46541
+ var _a, _b;
46542
+ var priceDetailsByProduct = groupBy(
46543
+ (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
46544
+ function (detail) {
46545
+ return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
46546
+ }
46547
+ );
46548
+ return (
46549
+ (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
46550
+ ).map(function (line) {
46551
+ var _a, _b, _c;
46552
+ var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
46553
+ var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
46554
+ return detail.showPrice || detail.isSeparate;
46555
+ });
46556
+ return React__default.createElement(
46557
+ 'li',
46558
+ { key: line.guid },
46559
+ React__default.createElement('h6', null, line.productName),
46560
+ React__default.createElement(
46561
+ 'ul',
46562
+ null,
46563
+ React__default.createElement('li', { className: 'list__item' }, compact([line.accommodationName, line.regimeName]).join(', ')),
46564
+ (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
46565
+ ? void 0
46566
+ : _c.map(function (flightLine, index) {
46567
+ var _a, _b;
46568
+ return React__default.createElement(
46569
+ 'li',
46570
+ { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
46571
+ flightLine.departureAirportCode,
46572
+ ' ',
46573
+ (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
46574
+ ' > ',
46575
+ flightLine.arrivalAirportCode,
46576
+ ' ',
46577
+ (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
46578
+ ' (',
46579
+ flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
46580
+ ')'
46581
+ );
46582
+ }),
46583
+ !isEmpty(visiblePriceDetails) &&
46584
+ visiblePriceDetails.map(function (detail, index) {
46585
+ var _a;
46586
+ return React__default.createElement(
46587
+ 'li',
46588
+ { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
46589
+ detail.priceDescription,
46590
+ ': ',
46591
+ (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
46592
+ );
46593
+ })
46594
+ ),
46595
+ React__default.createElement(
46596
+ 'p',
46597
+ null,
46598
+ '(',
46599
+ line.from === line.to
46600
+ ? getDateText(line.from)
46601
+ : React__default.createElement(React__default.Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
46602
+ ')'
46603
+ )
46604
+ );
46605
+ });
46606
+ };
46607
+ var getImageSrcFromHtml = function (html) {
46608
+ var _a;
46609
+ if (!html || typeof window === 'undefined') {
46610
+ return undefined;
46611
+ }
46612
+ var doc = new DOMParser().parseFromString(html, 'text/html');
46613
+ var img = doc.querySelector('img');
46614
+ return (_a = img === null || img === void 0 ? void 0 : img.getAttribute('src')) !== null && _a !== void 0 ? _a : undefined;
46615
+ };
46616
+
46513
46617
  var mapToSidebarFlightMetaData = function (entryLine) {
46514
46618
  var _a, _b;
46515
46619
  return {
@@ -46569,22 +46673,16 @@ var selectSeparatePackagePriceDetails = function (priceDetails) {
46569
46673
  return result;
46570
46674
  };
46571
46675
  var WLSidebar = function (_a) {
46572
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
46573
- var activeSearchSeed = _a.activeSearchSeed;
46676
+ 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;
46677
+ var activeSearchSeed = _a.activeSearchSeed,
46678
+ packagingAccoResult = _a.packagingAccoResult;
46574
46679
  var context = useContext(SearchResultsConfigurationContext);
46575
- if (!context) {
46576
- return null;
46577
- }
46578
- var translations = getTranslations((_b = context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46579
- var _u = useSelector(function (state) {
46680
+ var _4 = useSelector(function (state) {
46580
46681
  return state.searchResults;
46581
46682
  }),
46582
- editablePackagingEntry = _u.editablePackagingEntry,
46583
- priceDetails = _u.priceDetails;
46584
- // Map editablePackagingEntry to sidebar props (example, adjust as needed)
46585
- if (!editablePackagingEntry) {
46586
- return null;
46587
- }
46683
+ editablePackagingEntry = _4.editablePackagingEntry,
46684
+ priceDetails = _4.priceDetails;
46685
+ var translations = getTranslations((_b = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46588
46686
  var sortedLines = useMemo(
46589
46687
  function () {
46590
46688
  var _a;
@@ -46604,35 +46702,70 @@ var WLSidebar = function (_a) {
46604
46702
  },
46605
46703
  [editablePackagingEntry]
46606
46704
  );
46705
+ var accoImage = useMemo(
46706
+ function () {
46707
+ return getImageSrcFromHtml(packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.contents);
46708
+ },
46709
+ [packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.contents]
46710
+ );
46711
+ if (!context || !editablePackagingEntry) {
46712
+ return null;
46713
+ }
46607
46714
  var firstEntryLine = first(sortedLines);
46608
46715
  var accommodationLines = editablePackagingEntry.lines.filter(function (line) {
46609
46716
  return line.serviceType === ACCOMMODATION_SERVICE_TYPE;
46610
46717
  });
46611
46718
  var accommodationLine = (_c = first(accommodationLines)) !== null && _c !== void 0 ? _c : firstEntryLine;
46612
46719
  var location =
46613
- (_l =
46614
- (_j =
46615
- (_g =
46616
- (_e =
46617
- (_d = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _d === void 0
46720
+ context.searchConfiguration.qsmType === build.PortalQsmType.Accommodation
46721
+ ? (_m =
46722
+ (_k =
46723
+ (_h =
46724
+ (_f =
46725
+ (_d = packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.name) !== null && _d !== void 0
46726
+ ? _d
46727
+ : (_e = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _e === void 0
46728
+ ? void 0
46729
+ : _e.name) !== null && _f !== void 0
46730
+ ? _f
46731
+ : (_g = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _g === void 0
46732
+ ? void 0
46733
+ : _g.name) !== null && _h !== void 0
46734
+ ? _h
46735
+ : (_j = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _j === void 0
46618
46736
  ? void 0
46619
- : _d.name) !== null && _e !== void 0
46620
- ? _e
46621
- : (_f = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _f === void 0
46737
+ : _j.name) !== null && _k !== void 0
46738
+ ? _k
46739
+ : (_l = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _l === void 0
46622
46740
  ? void 0
46623
- : _f.name) !== null && _g !== void 0
46624
- ? _g
46625
- : (_h = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _h === void 0
46626
- ? void 0
46627
- : _h.name) !== null && _j !== void 0
46628
- ? _j
46629
- : (_k = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _k === void 0
46741
+ : _l.name) !== null && _m !== void 0
46742
+ ? _m
46743
+ : (_o = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _o === void 0
46630
46744
  ? void 0
46631
- : _k.name) !== null && _l !== void 0
46632
- ? _l
46633
- : (_m = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _m === void 0
46745
+ : _o.name
46746
+ : (_w =
46747
+ (_u =
46748
+ (_s =
46749
+ (_q =
46750
+ (_p = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _p === void 0
46751
+ ? void 0
46752
+ : _p.name) !== null && _q !== void 0
46753
+ ? _q
46754
+ : (_r = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _r === void 0
46755
+ ? void 0
46756
+ : _r.name) !== null && _s !== void 0
46757
+ ? _s
46758
+ : (_t = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _t === void 0
46759
+ ? void 0
46760
+ : _t.name) !== null && _u !== void 0
46761
+ ? _u
46762
+ : (_v = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _v === void 0
46763
+ ? void 0
46764
+ : _v.name) !== null && _w !== void 0
46765
+ ? _w
46766
+ : (_x = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _x === void 0
46634
46767
  ? void 0
46635
- : _m.name;
46768
+ : _x.name;
46636
46769
  var rooms =
46637
46770
  (activeSearchSeed === null || activeSearchSeed === void 0
46638
46771
  ? void 0
@@ -46662,7 +46795,7 @@ var WLSidebar = function (_a) {
46662
46795
  var outboundFlightMetaData = outboundFlight ? mapToSidebarFlightMetaData(outboundFlight) : undefined;
46663
46796
  var returnFlightMetaData = returnFlight ? mapToSidebarFlightMetaData(returnFlight) : undefined;
46664
46797
  var basePrice = sum(
46665
- (_o =
46798
+ (_y =
46666
46799
  priceDetails === null || priceDetails === void 0
46667
46800
  ? void 0
46668
46801
  : priceDetails.details
@@ -46671,18 +46804,18 @@ var WLSidebar = function (_a) {
46671
46804
  })
46672
46805
  .map(function (pd) {
46673
46806
  return pd.price * pd.amount;
46674
- })) !== null && _o !== void 0
46675
- ? _o
46807
+ })) !== null && _y !== void 0
46808
+ ? _y
46676
46809
  : []
46677
46810
  );
46678
46811
  var separateExtraPriceDetails =
46679
- (_p =
46812
+ (_z =
46680
46813
  priceDetails === null || priceDetails === void 0
46681
46814
  ? void 0
46682
46815
  : priceDetails.details.filter(function (pd) {
46683
46816
  return !pd.isInPackage && pd.isSeparate;
46684
- })) !== null && _p !== void 0
46685
- ? _p
46817
+ })) !== null && _z !== void 0
46818
+ ? _z
46686
46819
  : [];
46687
46820
  var totalPrice = sum(
46688
46821
  __spreadArray(
@@ -46694,22 +46827,22 @@ var WLSidebar = function (_a) {
46694
46827
  )
46695
46828
  );
46696
46829
  var includedCosts = selectSeparatePackagePriceDetails(
46697
- (_q =
46830
+ (_0 =
46698
46831
  priceDetails === null || priceDetails === void 0
46699
46832
  ? void 0
46700
46833
  : priceDetails.details.filter(function (pd) {
46701
46834
  return pd.isInPackage;
46702
- })) !== null && _q !== void 0
46703
- ? _q
46835
+ })) !== null && _0 !== void 0
46836
+ ? _0
46704
46837
  : []
46705
46838
  );
46706
46839
  return React__default.createElement(SharedSidebar, {
46707
46840
  productName: location !== null && location !== void 0 ? location : '',
46708
- thumbnailUrl: (_r = context.destinationImage) === null || _r === void 0 ? void 0 : _r.url,
46841
+ thumbnailUrl: accoImage !== null && accoImage !== void 0 ? accoImage : (_1 = context.destinationImage) === null || _1 === void 0 ? void 0 : _1.url,
46709
46842
  translations: translations,
46710
46843
  travelerRooms: travelerRooms,
46711
- startDateText: ((_s = first(sortedLines)) === null || _s === void 0 ? void 0 : _s.from) && formatDate(new Date(first(sortedLines).from)),
46712
- endDateText: ((_t = last(sortedLines)) === null || _t === void 0 ? void 0 : _t.to) && formatDate(new Date(last(sortedLines).to)),
46844
+ startDateText: ((_2 = first(sortedLines)) === null || _2 === void 0 ? void 0 : _2.from) && formatDate(new Date(first(sortedLines).from)),
46845
+ endDateText: ((_3 = last(sortedLines)) === null || _3 === void 0 ? void 0 : _3.to) && formatDate(new Date(last(sortedLines).to)),
46713
46846
  isLoading: !editablePackagingEntry || !priceDetails,
46714
46847
  loaderComponent: React__default.createElement(Spinner, null),
46715
46848
  departureFlightMetaData: outboundFlightMetaData,
@@ -47225,74 +47358,6 @@ var SharedSummary = function (_a) {
47225
47358
  );
47226
47359
  };
47227
47360
 
47228
- var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
47229
- var _a, _b;
47230
- var priceDetailsByProduct = groupBy(
47231
- (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
47232
- function (detail) {
47233
- return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
47234
- }
47235
- );
47236
- return (
47237
- (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
47238
- ).map(function (line) {
47239
- var _a, _b, _c;
47240
- var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
47241
- var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
47242
- return detail.showPrice || detail.isSeparate;
47243
- });
47244
- return React__default.createElement(
47245
- 'li',
47246
- { key: line.guid },
47247
- React__default.createElement('h6', null, line.productName),
47248
- React__default.createElement(
47249
- 'ul',
47250
- null,
47251
- React__default.createElement('li', { className: 'list__item' }, compact([line.accommodationName, line.regimeName]).join(', ')),
47252
- (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
47253
- ? void 0
47254
- : _c.map(function (flightLine, index) {
47255
- var _a, _b;
47256
- return React__default.createElement(
47257
- 'li',
47258
- { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
47259
- flightLine.departureAirportCode,
47260
- ' ',
47261
- (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
47262
- ' > ',
47263
- flightLine.arrivalAirportCode,
47264
- ' ',
47265
- (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
47266
- ' (',
47267
- flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
47268
- ')'
47269
- );
47270
- }),
47271
- !isEmpty(visiblePriceDetails) &&
47272
- visiblePriceDetails.map(function (detail, index) {
47273
- var _a;
47274
- return React__default.createElement(
47275
- 'li',
47276
- { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
47277
- detail.priceDescription,
47278
- ': ',
47279
- (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
47280
- );
47281
- })
47282
- ),
47283
- React__default.createElement(
47284
- 'p',
47285
- null,
47286
- '(',
47287
- line.from === line.to
47288
- ? getDateText(line.from)
47289
- : React__default.createElement(React__default.Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
47290
- ')'
47291
- )
47292
- );
47293
- });
47294
- };
47295
-
47296
47361
  var travelerFormFields = [{ type: 'gender' }, { type: 'firstName' }, { type: 'lastName' }, { type: 'birthDate' }];
47297
47362
  var mainBookerFormFields = [
47298
47363
  { type: 'street' },
@@ -47316,6 +47381,7 @@ var travellersSettings = {
47316
47381
  var BookPackagingEntry = function (_a) {
47317
47382
  var _b;
47318
47383
  var activeSearchSeed = _a.activeSearchSeed,
47384
+ isLoading = _a.isLoading,
47319
47385
  isConfirmationPage = _a.isConfirmationPage;
47320
47386
  var context = useContext(SearchResultsConfigurationContext);
47321
47387
  var dispatch = useDispatch();
@@ -47325,7 +47391,9 @@ var BookPackagingEntry = function (_a) {
47325
47391
  editablePackagingEntry = _c.editablePackagingEntry,
47326
47392
  priceDetails = _c.priceDetails,
47327
47393
  currentStep = _c.currentStep,
47328
- bookingNumber = _c.bookingNumber;
47394
+ bookingNumber = _c.bookingNumber,
47395
+ selectedPackagingAccoResultCode = _c.selectedPackagingAccoResultCode,
47396
+ packagingAccoResults = _c.packagingAccoResults;
47329
47397
  var _d = useState([]),
47330
47398
  countries = _d[0],
47331
47399
  setCountries = _d[1];
@@ -47338,6 +47406,9 @@ var BookPackagingEntry = function (_a) {
47338
47406
  var _g = useState(false),
47339
47407
  isSubmitting = _g[0],
47340
47408
  setIsSubmitting = _g[1];
47409
+ var _h = useState(null),
47410
+ selectedPackagingAccoResult = _h[0],
47411
+ setSelectedPackagingAccoResult = _h[1];
47341
47412
  var translations = useMemo(
47342
47413
  function () {
47343
47414
  var _a;
@@ -47416,7 +47487,22 @@ var BookPackagingEntry = function (_a) {
47416
47487
  },
47417
47488
  [isConfirmationPage, dispatch]
47418
47489
  );
47419
- if (!context || !editablePackagingEntry || !priceDetails || !config) return null;
47490
+ useEffect(
47491
+ function () {
47492
+ var selectedPackagingAccoResult =
47493
+ packagingAccoResults === null || packagingAccoResults === void 0
47494
+ ? void 0
47495
+ : packagingAccoResults.find(function (result) {
47496
+ return result.code === selectedPackagingAccoResultCode;
47497
+ });
47498
+ if (selectedPackagingAccoResult) {
47499
+ setSelectedPackagingAccoResult(selectedPackagingAccoResult);
47500
+ }
47501
+ },
47502
+ [selectedPackagingAccoResultCode, packagingAccoResults]
47503
+ );
47504
+ if (!context || !editablePackagingEntry || !priceDetails || !config)
47505
+ return React__default.createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING });
47420
47506
  var handleSummarySubmit = function (e) {
47421
47507
  return __awaiter(void 0, void 0, void 0, function () {
47422
47508
  var updatedEditablePackagingEntry, redirectUrl, request, bookingResponse;
@@ -47442,7 +47528,7 @@ var BookPackagingEntry = function (_a) {
47442
47528
  dispatch(setEditablePackagingEntry(updatedEditablePackagingEntry));
47443
47529
  _c.label = 1;
47444
47530
  case 1:
47445
- _c.trys.push([1, 3, 4, 5]);
47531
+ _c.trys.push([1, 3, , 4]);
47446
47532
  request = {
47447
47533
  language: (_a = context.languageCode) !== null && _a !== void 0 ? _a : 'en-GB',
47448
47534
  officeId: context.tideConnection.officeId,
@@ -47458,16 +47544,14 @@ var BookPackagingEntry = function (_a) {
47458
47544
  window.location.href = bookingResponse.paymentUrl;
47459
47545
  } else {
47460
47546
  dispatch(setCurrentStep(2));
47547
+ setIsSubmitting(false);
47461
47548
  }
47462
- return [3 /*break*/, 5];
47549
+ return [3 /*break*/, 4];
47463
47550
  case 3:
47464
47551
  _c.sent();
47465
47552
  dispatch(setCurrentStep(3));
47466
- return [3 /*break*/, 5];
47553
+ return [3 /*break*/, 4];
47467
47554
  case 4:
47468
- setIsSubmitting(false);
47469
- return [7 /*endfinally*/];
47470
- case 5:
47471
47555
  return [2 /*return*/];
47472
47556
  }
47473
47557
  });
@@ -47492,6 +47576,7 @@ var BookPackagingEntry = function (_a) {
47492
47576
  return React__default.createElement(React__default.Fragment, null, step + 1, '.\u00A0', stepLabels[step]);
47493
47577
  }
47494
47578
  },
47579
+ isConfirmationPage && isLoading && React__default.createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING }),
47495
47580
  currentStep === 0 &&
47496
47581
  React__default.createElement(SharedTravelersForm, {
47497
47582
  formik: formik,
@@ -47554,7 +47639,7 @@ var BookPackagingEntry = function (_a) {
47554
47639
  )
47555
47640
  ),
47556
47641
  React__default.createElement('div', { className: 'backdrop', id: 'backdrop' }),
47557
- React__default.createElement(WLSidebar, { activeSearchSeed: activeSearchSeed })
47642
+ React__default.createElement(WLSidebar, { activeSearchSeed: activeSearchSeed, packagingAccoResult: selectedPackagingAccoResult })
47558
47643
  )
47559
47644
  );
47560
47645
  };
@@ -49134,7 +49219,11 @@ var SearchResultsContainer = function (_a) {
49134
49219
  'div',
49135
49220
  { className: 'search' },
49136
49221
  bookPackagingEntry
49137
- ? React__default.createElement(BookPackagingEntry, { activeSearchSeed: activeSearchSeed, isConfirmationPage: isBookingConfirmation })
49222
+ ? React__default.createElement(BookPackagingEntry, {
49223
+ activeSearchSeed: activeSearchSeed,
49224
+ isLoading: itineraryIsLoading || pricesAreLoading,
49225
+ isConfirmationPage: isBookingConfirmation
49226
+ })
49138
49227
  : React__default.createElement(
49139
49228
  'div',
49140
49229
  { 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.4.113",
3
+ "version": "1.4.115",
4
4
  "description": "React Booking wizard & Booking product component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "types": "build/build-cjs/src/index.d.ts",