@odynn/awayz-core 0.9.34 → 0.10.0

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 (50) hide show
  1. package/dist/{TripsService-k5PnDpcP.js → TripsService-fNtCUyxa.js} +1 -1
  2. package/dist/assets/_styles.css +1 -1
  3. package/dist/assets/_styles2.css +1 -1
  4. package/dist/assets/_styles3.css +1 -1
  5. package/dist/assets/_styles4.css +1 -1
  6. package/dist/assets/_styles5.css +1 -1
  7. package/dist/assets/_styles6.css +1 -1
  8. package/dist/components/Bookings/FlightBooking/FlightBooking.js +4 -3
  9. package/dist/components/Bookings/HotelBooking/HotelBooking.js +30 -22
  10. package/dist/components/CashValue/CashValue.js +3 -3
  11. package/dist/components/CashValue/CashValue.stories.js +3 -3
  12. package/dist/components/ClientPointsValue/ClientPointsValue.js +3 -3
  13. package/dist/components/Menu/Menu.js +1 -1
  14. package/dist/components/Modal/Modal.js +1 -1
  15. package/dist/components/Tooltip/Tooltip.js +1 -1
  16. package/dist/components/Wallet/Card/Card.js +1 -1
  17. package/dist/components/Wallet/Card/Card.stories.js +3 -3
  18. package/dist/hooks/index.js +4 -2
  19. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +10 -9
  20. package/dist/hooks/useBookingManagement/useBookingManagement.js +100 -87
  21. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +17 -16
  22. package/dist/hooks/useBookingManagement/useBookingManagement.types.js +4 -1
  23. package/dist/hooks/useFeatureFlags.js +1 -1
  24. package/dist/hooks/useSearchLimit.js +1 -1
  25. package/dist/hooks/useTripManagement/useTripManagement.js +4 -4
  26. package/dist/hooks/useTripManagement/useTripManagement.test.js +4 -4
  27. package/dist/hooks/useWallet/useWallet.js +3 -3
  28. package/dist/hooks/useWallet/useWallet.test.js +3 -3
  29. package/dist/keys-BcBfU51M.js +5 -0
  30. package/dist/lib/hooks/index.d.ts +1 -0
  31. package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +29 -8
  32. package/dist/lib/services/bookings/BookingService.types.d.ts +16 -0
  33. package/dist/main.js +28 -26
  34. package/dist/{noRetryInstance-Bit3xLkY.js → noRetryInstance-C4bqpBc7.js} +17 -16
  35. package/dist/providers/AwayzProvider.js +6 -5
  36. package/dist/services/account/AccountService.js +2 -2
  37. package/dist/services/bookings/BookingService.js +69 -60
  38. package/dist/services/currency/CurrencyService.js +3 -3
  39. package/dist/services/features/featureService.js +1 -1
  40. package/dist/services/index.js +1 -1
  41. package/dist/services/instance.js +2 -2
  42. package/dist/services/instanceConfig.js +11 -10
  43. package/dist/services/noRetryInstance.js +1 -1
  44. package/dist/services/preferences/PreferencesService.js +1 -1
  45. package/dist/services/rewards/RewardsService.js +1 -1
  46. package/dist/services/trips/TripsService.js +2 -2
  47. package/dist/services/wallet/WalletService.js +1 -1
  48. package/dist/utils/clientPoints.js +3 -3
  49. package/package.json +1 -1
  50. package/dist/_styles.flight-booking-CaUgKcMC.js +0 -5
@@ -4,3 +4,4 @@ import { useSearchLimit } from './useSearchLimit';
4
4
  import { useTripManagement } from './useTripManagement/useTripManagement';
5
5
  import { useWallet } from './useWallet/useWallet';
6
6
  export { useAwayzContext, useBookingManagement, useSearchLimit, useTripManagement, useWallet };
7
+ export { ECancelStatus } from './useBookingManagement/useBookingManagement.types';
@@ -1,4 +1,12 @@
1
1
  import { IFlightBookingDetails, IHotelBookingDetails, IPointsAsCash } from '../../services/bookings/BookingService.types';
2
+ export declare enum ECancelStatus {
3
+ IDLE = "idle",
4
+ PENDING = "pending",
5
+ SUCCESS = "success",
6
+ /** Booking was cancelled but the points refund step failed */
7
+ POINTS_REFUND_FAILED = "points_refund_failed",
8
+ CANCEL_FAILED = "cancel_failed"
9
+ }
2
10
  export interface IUseBookingManagement {
3
11
  /**
4
12
  * The booking details, which can be either hotel or flight booking details
@@ -39,26 +47,39 @@ export interface IUseBookingManagement {
39
47
  */
40
48
  cancelBooking: () => void;
41
49
  /**
42
- * Indicates if the cancel booking request is successful
50
+ * The current status of the cancellation flow.
51
+ * Transitions: IDLE → PENDING → SUCCESS | CANCEL_FAILED | POINTS_REFUND_FAILED
43
52
  */
44
- isCancelBookingSuccess: boolean;
53
+ cancelStatus: ECancelStatus;
54
+ /**
55
+ * Resets cancelStatus back to IDLE. Call this when the consumer has finished
56
+ * handling the terminal state (e.g. when the cancel modal is dismissed).
57
+ */
58
+ resetCancelStatus: () => void;
59
+ /**
60
+ * The error object if cancelStatus is CANCEL_FAILED (booking cancellation failed)
61
+ */
62
+ cancelBookingError: Error | null;
63
+ /**
64
+ * The error object if cancelStatus is POINTS_REFUND_FAILED (points refund step failed)
65
+ */
66
+ pointsRefundError: Error | null;
45
67
  /**
46
68
  * Indicates if the cancel booking request is pending
47
69
  */
48
70
  isCancellingBooking: boolean;
49
71
  /**
50
- * Indicates if the cancel booking request is pending
51
- * @deprecated Use `isCancellingBooking` instead
72
+ * @deprecated Use `isCancellingBooking` instead (fixed spelling)
52
73
  */
53
74
  isCancelingBooking: boolean;
54
75
  /**
55
- * Indicates if there was an error while cancelling the booking
76
+ * @deprecated Use `cancelStatus === ECancelStatus.SUCCESS` instead
56
77
  */
57
- isCancelBookingError: boolean;
78
+ isCancelBookingSuccess: boolean;
58
79
  /**
59
- * The error object if there was an error while cancelling the booking
80
+ * @deprecated Use `cancelStatus === ECancelStatus.CANCEL_FAILED` instead
60
81
  */
61
- cancelBookingError: Error | null;
82
+ isCancelBookingError: boolean;
62
83
  /**
63
84
  * Function to handle airline initiated changes
64
85
  * This is **ONLY** used for flight bookings
@@ -50,6 +50,14 @@ export interface IBed {
50
50
  type: string;
51
51
  count: number;
52
52
  }
53
+ export interface IPointsAsCashRefund {
54
+ pointsRefunded: number;
55
+ cashRefunded: {
56
+ amount: number;
57
+ currency: string;
58
+ };
59
+ refundPercentage: number;
60
+ }
53
61
  export interface IPointsAsCash {
54
62
  authCode: string;
55
63
  points: number;
@@ -60,6 +68,7 @@ export interface IPointsAsCash {
60
68
  amount: number;
61
69
  currency: string;
62
70
  };
71
+ refund?: IPointsAsCashRefund;
63
72
  statusHistory: {
64
73
  status: string;
65
74
  timestamp: string;
@@ -81,6 +90,12 @@ export interface IFlightConditions {
81
90
  refundBeforeDeparture: IFlightConditionDetails;
82
91
  changeBeforeDeparture: IFlightConditionDetails;
83
92
  }
93
+ export interface IFlightCancellationDetails {
94
+ refundAmount: number;
95
+ refundCurrency: string;
96
+ refundTo: string;
97
+ confirmedAt: string;
98
+ }
84
99
  export interface IFlightBookingDetails {
85
100
  id: string;
86
101
  flightOfferId: string;
@@ -92,6 +107,7 @@ export interface IFlightBookingDetails {
92
107
  currency: string;
93
108
  status: string;
94
109
  cancelledAt?: string;
110
+ cancellationDetails?: IFlightCancellationDetails;
95
111
  conditions: IFlightConditions;
96
112
  class: string;
97
113
  passengers: {
package/dist/main.js CHANGED
@@ -11,45 +11,47 @@ import { useBookingManagement as B } from "./hooks/useBookingManagement/useBooki
11
11
  import { useSearchLimit as d } from "./hooks/useSearchLimit.js";
12
12
  import { ETripStatus as A, useTripManagement as T } from "./hooks/useTripManagement/useTripManagement.js";
13
13
  import { useWallet as P } from "./hooks/useWallet/useWallet.js";
14
- import { AwayzProvider as I } from "./providers/AwayzProvider.js";
15
- import { CurrencyService as D } from "./services/currency/CurrencyService.js";
16
- import { c as O, a as R, g as V, i as H } from "./noRetryInstance-Bit3xLkY.js";
17
- import { RewardsService as N } from "./services/rewards/RewardsService.js";
18
- import { EBookingType as W } from "./services/trips/TripService.types.js";
19
- import { EAuthFlow as j } from "./types/EAuthFlow.js";
20
- import { convertCashToClientPoints as G } from "./utils/clientPoints.js";
21
- import { getCurrency as K } from "./utils/currency.js";
22
- import { EAmountsDisplayFeature as X, EBookingPaymentMethod as Y, EFlightBookingOptionsDisplayFeature as Z, useFeatureFlags as _ } from "./hooks/useFeatureFlags.js";
23
- import { getBaseUrl as oo } from "./configs/baseUrl.js";
14
+ import { ECancelStatus as z } from "./hooks/useBookingManagement/useBookingManagement.types.js";
15
+ import { AwayzProvider as D } from "./providers/AwayzProvider.js";
16
+ import { CurrencyService as O } from "./services/currency/CurrencyService.js";
17
+ import { c as V, a as H, g as L, i as N } from "./noRetryInstance-C4bqpBc7.js";
18
+ import { RewardsService as W } from "./services/rewards/RewardsService.js";
19
+ import { EBookingType as j } from "./services/trips/TripService.types.js";
20
+ import { EAuthFlow as G } from "./types/EAuthFlow.js";
21
+ import { convertCashToClientPoints as K } from "./utils/clientPoints.js";
22
+ import { getCurrency as X } from "./utils/currency.js";
23
+ import { EAmountsDisplayFeature as Z, EBookingPaymentMethod as _, EFlightBookingOptionsDisplayFeature as $, useFeatureFlags as oo } from "./hooks/useFeatureFlags.js";
24
+ import { getBaseUrl as ro } from "./configs/baseUrl.js";
24
25
  export {
25
- I as AwayzProvider,
26
+ D as AwayzProvider,
26
27
  u as Card,
27
28
  i as CashValue,
28
29
  x as ClientPointsValue,
29
- D as CurrencyService,
30
- X as EAmountsDisplayFeature,
31
- j as EAuthFlow,
32
- Y as EBookingPaymentMethod,
33
- W as EBookingType,
34
- Z as EFlightBookingOptionsDisplayFeature,
30
+ O as CurrencyService,
31
+ Z as EAmountsDisplayFeature,
32
+ G as EAuthFlow,
33
+ _ as EBookingPaymentMethod,
34
+ j as EBookingType,
35
+ z as ECancelStatus,
36
+ $ as EFlightBookingOptionsDisplayFeature,
35
37
  m as EInvalidAmountDisplayOption,
36
38
  s as EToolTipPosition,
37
39
  A as ETripStatus,
38
40
  r as FlightBooking,
39
41
  a as HotelBooking,
40
- N as RewardsService,
42
+ W as RewardsService,
41
43
  c as awayzClient,
42
- O as clientInstance,
43
- R as clientNoRetryInstance,
44
- G as convertCashToClientPoints,
44
+ V as clientInstance,
45
+ H as clientNoRetryInstance,
46
+ K as convertCashToClientPoints,
45
47
  C as defaultAwayzConfig,
46
- V as gatewayInstance,
47
- oo as getBaseUrl,
48
- K as getCurrency,
49
- H as instance,
48
+ L as gatewayInstance,
49
+ ro as getBaseUrl,
50
+ X as getCurrency,
51
+ N as instance,
50
52
  h as useAwayzContext,
51
53
  B as useBookingManagement,
52
- _ as useFeatureFlags,
54
+ oo as useFeatureFlags,
53
55
  d as useSearchLimit,
54
56
  T as useTripManagement,
55
57
  P as useWallet
@@ -1,8 +1,8 @@
1
- import './assets/_styles3.css';import './assets/_styles5.css';import './assets/_styles4.css';import './assets/_styles.css';import './assets/_styles2.css';import './assets/noRetryInstance.css';var pt = Object.defineProperty;
1
+ import './assets/_styles4.css';import './assets/_styles6.css';import './assets/_styles5.css';import './assets/_styles2.css';import './assets/_styles.css';import './assets/_styles3.css';import './assets/noRetryInstance.css';var pt = Object.defineProperty;
2
2
  var ht = (e, t, n) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var I = (e, t, n) => ht(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import "./arrayExtensions-DlcBOj5a.js";
5
- import { a as U } from "./_styles.flight-booking-CaUgKcMC.js";
5
+ import { a as U } from "./keys-BcBfU51M.js";
6
6
  import "react";
7
7
  import { getBaseUrl as He } from "./configs/baseUrl.js";
8
8
  import { EAuthEndpoints as b } from "./configs/endpoints.js";
@@ -11,6 +11,7 @@ import "@tanstack/react-query";
11
11
  import "react/jsx-runtime";
12
12
  import "react-i18next";
13
13
  /* empty css */
14
+ /* empty css */
14
15
  /* empty css */
15
16
  import { awayzClient as $ } from "./configs/awayzClient.js";
16
17
  /* empty css */
@@ -1715,22 +1716,22 @@ g.getAdapter = at.getAdapter;
1715
1716
  g.HttpStatusCode = Ee;
1716
1717
  g.default = g;
1717
1718
  const {
1718
- Axios: xr,
1719
+ Axios: Pr,
1719
1720
  AxiosError: Zn,
1720
- CanceledError: Pr,
1721
- isCancel: kr,
1722
- CancelToken: Fr,
1723
- VERSION: Dr,
1724
- all: Br,
1725
- Cancel: qr,
1726
- isAxiosError: Hr,
1727
- spread: Mr,
1728
- toFormData: jr,
1729
- AxiosHeaders: zr,
1721
+ CanceledError: kr,
1722
+ isCancel: Fr,
1723
+ CancelToken: Dr,
1724
+ VERSION: Br,
1725
+ all: qr,
1726
+ Cancel: Hr,
1727
+ isAxiosError: Mr,
1728
+ spread: jr,
1729
+ toFormData: zr,
1730
+ AxiosHeaders: Gr,
1730
1731
  HttpStatusCode: F,
1731
- formToJSON: Gr,
1732
- getAdapter: $r,
1733
- mergeConfig: Kr
1732
+ formToJSON: $r,
1733
+ getAdapter: Kr,
1734
+ mergeConfig: Vr
1734
1735
  } = g, ft = (e) => (e.baseURL = He(), e.headers.Authorization = localStorage.getItem(U.TOKEN), e.headers["client-id"] = localStorage.getItem(U.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Qn = (e) => (e.baseURL = mt(), e.headers.Authorization = localStorage.getItem(U.TOKEN), e.headers["client-id"] = localStorage.getItem(U.CLIENT_ID), e.headers["Api-Version"] = "1.0", e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), De = (e, t, n) => {
1735
1736
  for (const r of e)
1736
1737
  t ? r.rej(t) : r.res(n);
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { QueryClientProvider as l } from "@tanstack/react-query";
3
3
  import "../arrayExtensions-DlcBOj5a.js";
4
- import { a as r } from "../_styles.flight-booking-CaUgKcMC.js";
4
+ import { a as r } from "../keys-BcBfU51M.js";
5
5
  import { useEffect as i } from "react";
6
6
  import { setCustomBaseUrl as u, setBaseUrl as d } from "../configs/baseUrl.js";
7
7
  import { defaultAwayzConfig as p } from "../configs/defaultAwayzConfig.js";
@@ -9,16 +9,17 @@ import { setGatewayBaseUrl as h } from "../configs/gatewayBaseUrl.js";
9
9
  import { AwayzContext as w } from "../context/AwayzContext.js";
10
10
  import { useAwayzAuth as n } from "../hooks/useAwayzAuth/useAwayzAuth.js";
11
11
  import "react-i18next";
12
- import '../assets/_styles3.css';import '../assets/_styles5.css';import '../assets/_styles4.css';import '../assets/_styles.css';import '../assets/_styles2.css';/* empty css */
12
+ import '../assets/_styles4.css';import '../assets/_styles6.css';import '../assets/_styles5.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles3.css';/* empty css */
13
+ /* empty css */
13
14
  /* empty css */
14
15
  import { awayzClient as y } from "../configs/awayzClient.js";
15
- import "../noRetryInstance-Bit3xLkY.js";
16
+ import "../noRetryInstance-C4bqpBc7.js";
16
17
  /* empty css */
17
18
  /* empty css */
18
19
  import "../index-Cv-wvFlM.js";
19
20
  /* empty css */
20
21
  import { useFeatureFlags as A } from "../hooks/useFeatureFlags.js";
21
- const N = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: y, children: /* @__PURE__ */ o(F, { config: e, children: t }) }), F = ({ children: t, config: e }) => {
22
+ const _ = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: y, children: /* @__PURE__ */ o(F, { config: e, children: t }) }), F = ({ children: t, config: e }) => {
22
23
  const a = n({
23
24
  authFlow: e.authFlow,
24
25
  onSuccess: e.onAuthSuccess,
@@ -49,5 +50,5 @@ const N = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: y, chil
49
50
  );
50
51
  };
51
52
  export {
52
- N as AwayzProvider
53
+ _ as AwayzProvider
53
54
  };
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { A as e } from "../../noRetryInstance-Bit3xLkY.js";
3
- import "../../_styles.flight-booking-CaUgKcMC.js";
2
+ import { A as e } from "../../noRetryInstance-C4bqpBc7.js";
3
+ import "../../keys-BcBfU51M.js";
4
4
  import "react";
5
5
  import "../../configs/awayzClient.js";
6
6
  import "../../configs/endpoints.js";
@@ -1,39 +1,39 @@
1
1
  var g = Object.defineProperty;
2
- var y = (r, t, a) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[t] = a;
3
- var c = (r, t, a) => y(r, typeof t != "symbol" ? t + "" : t, a);
2
+ var f = (c, t, a) => t in c ? g(c, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[t] = a;
3
+ var r = (c, t, a) => f(c, typeof t != "symbol" ? t + "" : t, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as d, b as u, g as p } from "../../noRetryInstance-Bit3xLkY.js";
5
+ import { c as l, b as _, g as p } from "../../noRetryInstance-C4bqpBc7.js";
6
6
  import "react";
7
7
  import { EBookingEndpoints as i } from "../../configs/endpoints.js";
8
- const f = (r) => {
9
- const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = r.match(t);
8
+ const y = (c) => {
9
+ const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = c.match(t);
10
10
  if (a) {
11
- const o = a[2] ? `${a[2]}d ` : "", e = a[4] ? `${a[4]}h ` : "", l = a[6] ? `${a[6]}m` : "";
12
- return `${o}${e}${l}`.trim();
11
+ const n = a[2] ? `${a[2]}d ` : "", d = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
12
+ return `${n}${d}${s}`.trim();
13
13
  } else
14
- return r;
14
+ return c;
15
15
  };
16
16
  class h {
17
17
  constructor() {
18
- c(this, "getHotelBooking", async (t) => {
19
- var l, _;
20
- const { data: a } = await d.get(
18
+ r(this, "getHotelBooking", async (t) => {
19
+ var s, e;
20
+ const { data: a } = await l.get(
21
21
  `${i.USER_HOTEL_BOOKINGS}/${t}`
22
- ), o = a.data.accommodation.rooms[0].rates[0];
22
+ ), n = a.data.accommodation.rooms[0].rates[0];
23
23
  return {
24
24
  id: a.data._id,
25
25
  rateId: a.data.rate_id,
26
26
  quoteId: a.data.quote_id,
27
27
  bookingId: a.data.id,
28
- totalAmount: parseFloat(o.total_amount),
29
- feeAmount: parseFloat(o.fee_amount),
30
- taxAmount: parseFloat(o.tax_amount),
31
- baseAmount: parseFloat(o.base_amount),
28
+ totalAmount: parseFloat(n.total_amount),
29
+ feeAmount: parseFloat(n.fee_amount),
30
+ taxAmount: parseFloat(n.tax_amount),
31
+ baseAmount: parseFloat(n.base_amount),
32
32
  cancelledAt: a.data.cancelled_at,
33
- totalCurrency: o.total_currency,
34
- baseCurrency: o.base_currency,
35
- feeCurrency: o.fee_currency,
36
- taxCurrency: o.tax_currency,
33
+ totalCurrency: n.total_currency,
34
+ baseCurrency: n.base_currency,
35
+ feeCurrency: n.fee_currency,
36
+ taxCurrency: n.tax_currency,
37
37
  status: a.data.status,
38
38
  description: a.data.accommodation.description,
39
39
  name: a.data.accommodation.name,
@@ -53,39 +53,40 @@ class h {
53
53
  latitude: a.data.accommodation.location.geographic_coordinates.latitude,
54
54
  longitude: a.data.accommodation.location.geographic_coordinates.longitude
55
55
  },
56
- images: a.data.accommodation.photos.map((n) => n.url),
57
- guests: a.data.guests.map((n, m) => {
58
- var s;
56
+ images: a.data.accommodation.photos.map((o) => o.url),
57
+ guests: a.data.guests.map((o, m) => {
58
+ var u;
59
59
  return {
60
- familyName: n.family_name,
61
- givenName: n.given_name,
62
- type: (s = a.data.guest_types[m]) == null ? void 0 : s.type
60
+ familyName: o.family_name,
61
+ givenName: o.given_name,
62
+ type: (u = a.data.guest_types[m]) == null ? void 0 : u.type
63
63
  };
64
64
  }),
65
- numberOfRooms: (l = a.data.rooms) == null ? void 0 : l.length,
66
- cancellationTimeline: o.cancellation_timeline.map(
67
- (n) => ({
68
- refundAmount: parseFloat(n.refund_amount),
69
- currency: n.currency,
70
- before: n.before
65
+ numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
66
+ cancellationTimeline: n.cancellation_timeline.map(
67
+ (o) => ({
68
+ refundAmount: parseFloat(o.refund_amount),
69
+ currency: o.currency,
70
+ before: o.before
71
71
  })
72
72
  ),
73
- rooms: (_ = a.data.rooms) == null ? void 0 : _.map((n) => {
73
+ rooms: (e = a.data.rooms) == null ? void 0 : e.map((o) => {
74
74
  var m;
75
75
  return {
76
- beds: (m = n.beds) == null ? void 0 : m.map((s) => ({
77
- type: s.type,
78
- count: s.count
76
+ beds: (m = o.beds) == null ? void 0 : m.map((u) => ({
77
+ type: u.type,
78
+ count: u.count
79
79
  })),
80
- totalAmount: parseFloat(n.total_amount),
81
- name: n.name
80
+ totalAmount: parseFloat(o.total_amount),
81
+ name: o.name
82
82
  };
83
83
  }),
84
84
  createdAt: a.data.created_at
85
85
  };
86
86
  });
87
- c(this, "getFlightBooking", async (t) => {
88
- const { data: a } = await d.get(
87
+ r(this, "getFlightBooking", async (t) => {
88
+ var d, s;
89
+ const { data: a } = await l.get(
89
90
  `${i.USER_FLIGHT_BOOKINGS}/${t}`
90
91
  );
91
92
  return {
@@ -112,11 +113,11 @@ class h {
112
113
  penaltyCurrency: a.data.conditions.refund_before_departure.penalty_currency
113
114
  }
114
115
  },
115
- class: a.data.slices[0].fare_brand_name,
116
+ class: (d = a.data.slices[0]) == null ? void 0 : d.fare_brand_name,
116
117
  flightOfferId: a.data.offer_id,
117
118
  orderId: a.data.order_id,
118
119
  cancelledAt: a.data.cancelled_at,
119
- airlines: a.data.slices[0].segments.map((e) => ({
120
+ airlines: (((s = a.data.slices[0]) == null ? void 0 : s.segments) ?? []).map((e) => ({
120
121
  name: e.operating_carrier.name,
121
122
  code: e.operating_carrier.iata_code,
122
123
  logo: e.operating_carrier.logo_symbol_url
@@ -136,49 +137,57 @@ class h {
136
137
  arrivingAt: e.segments.getLast().arriving_at,
137
138
  numberOfStops: e.segments.length - 1,
138
139
  reference: a.data.booking_reference,
139
- durationInMinutes: f(e.duration),
140
- origin: u(e.origin),
141
- destination: u(e.destination),
142
- segments: u(e.segments)
140
+ durationInMinutes: y(e.duration),
141
+ origin: _(e.origin),
142
+ destination: _(e.destination),
143
+ segments: _(e.segments)
143
144
  })),
144
145
  availableActions: a.data.available_actions,
145
- airlineInitiatedChanges: u(a.data.airline_initiated_changes) || []
146
+ airlineInitiatedChanges: _(a.data.airline_initiated_changes) || [],
147
+ cancellationDetails: a.data.cancellation_details ? {
148
+ refundAmount: parseFloat(
149
+ a.data.cancellation_details.refund_amount
150
+ ),
151
+ refundCurrency: a.data.cancellation_details.refund_currency,
152
+ refundTo: a.data.cancellation_details.refund_to,
153
+ confirmedAt: a.data.cancellation_details.confirmed_at
154
+ } : void 0
146
155
  };
147
156
  });
148
- c(this, "initiateCancelFlightBooking", async (t) => {
149
- const { data: a } = await d.put(
157
+ r(this, "initiateCancelFlightBooking", async (t) => {
158
+ const { data: a } = await l.put(
150
159
  `${i.INITIATE_FLIGHT_CANCEL}/${t}`
151
160
  );
152
161
  return a.success;
153
162
  });
154
- c(this, "confirmCancelFlightBooking", async (t) => {
155
- const { data: a } = await d.put(
163
+ r(this, "confirmCancelFlightBooking", async (t) => {
164
+ const { data: a } = await l.put(
156
165
  `${i.CONFIRM_FLIGHT_CANCEL}/${t}`
157
166
  );
158
167
  return a.success;
159
168
  });
160
- c(this, "cancelHotelBooking", async (t) => {
161
- const { data: a } = await d.post(
169
+ r(this, "cancelHotelBooking", async (t) => {
170
+ const { data: a } = await l.post(
162
171
  `${i.CANCEL_HOTEL_BOOKING}/${t}`
163
172
  );
164
173
  return a.success;
165
174
  });
166
- c(this, "actionAirlineChanges", async ({
175
+ r(this, "actionAirlineChanges", async ({
167
176
  bookingId: t,
168
177
  acceptChanges: a,
169
- aicId: o
178
+ aicId: n
170
179
  }) => {
171
- const { data: e } = await d.post(
180
+ const { data: d } = await l.post(
172
181
  i.ACTION_AIRLINE_CHANGES,
173
182
  {
174
183
  booking_id: t,
175
184
  action_taken: a ? "accepted" : "cancelled",
176
- aic_id: o
185
+ aic_id: n
177
186
  }
178
187
  );
179
- return e.success;
188
+ return d.success;
180
189
  });
181
- c(this, "cancelPointsBooking", async (t) => {
190
+ r(this, "cancelPointsBooking", async (t) => {
182
191
  const { data: a } = await p.post(
183
192
  `${i.REFUND_POINTS_BOOKING}`,
184
193
  {
@@ -187,7 +196,7 @@ class h {
187
196
  );
188
197
  return a.success;
189
198
  });
190
- c(this, "getPointsAsCash", async (t) => {
199
+ r(this, "getPointsAsCash", async (t) => {
191
200
  const { data: a } = await p.get(
192
201
  `${i.BOOKING_POINTS_AS_CASH}/${t}`
193
202
  );
@@ -1,14 +1,14 @@
1
- import '../../assets/_styles3.css';import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles.css';import '../../assets/_styles2.css';var f = Object.defineProperty;
1
+ import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '../../assets/_styles5.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';var f = Object.defineProperty;
2
2
  var l = (c, r, t) => r in c ? f(c, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[r] = t;
3
3
  var o = (c, r, t) => l(c, typeof r != "symbol" ? r + "" : r, t);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { A as i, E as u, c as y } from "../../noRetryInstance-Bit3xLkY.js";
5
+ import { A as i, E as u, c as y } from "../../noRetryInstance-C4bqpBc7.js";
6
6
  import "react";
7
7
  import { ECurrencyEndpoints as p } from "../../configs/endpoints.js";
8
8
  import "react/jsx-runtime";
9
9
  import "react-i18next";
10
10
  /* empty css */
11
- import "../../_styles.flight-booking-CaUgKcMC.js";
11
+ /* empty css */
12
12
  /* empty css */
13
13
  import "@tanstack/react-query";
14
14
  /* empty css */
@@ -1,5 +1,5 @@
1
1
  import { EAuthEndpoints as a } from "../../configs/endpoints.js";
2
- import { c as o } from "../../noRetryInstance-Bit3xLkY.js";
2
+ import { c as o } from "../../noRetryInstance-C4bqpBc7.js";
3
3
  class i {
4
4
  static async getFeatures() {
5
5
  try {
@@ -1,5 +1,5 @@
1
1
  import { CurrencyService as a } from "./currency/CurrencyService.js";
2
- import { c as t, a as o, g as c, i as s } from "../noRetryInstance-Bit3xLkY.js";
2
+ import { c as t, a as o, g as c, i as s } from "../noRetryInstance-C4bqpBc7.js";
3
3
  import { RewardsService as p } from "./rewards/RewardsService.js";
4
4
  import { EBookingType as m } from "./trips/TripService.types.js";
5
5
  export {
@@ -1,7 +1,7 @@
1
1
  import "../arrayExtensions-DlcBOj5a.js";
2
- import "../_styles.flight-booking-CaUgKcMC.js";
2
+ import "../keys-BcBfU51M.js";
3
3
  import "react";
4
- import { c as r, g as s, i as c } from "../noRetryInstance-Bit3xLkY.js";
4
+ import { c as r, g as s, i as c } from "../noRetryInstance-C4bqpBc7.js";
5
5
  import "../configs/baseUrl.js";
6
6
  export {
7
7
  r as clientInstance,
@@ -1,14 +1,15 @@
1
1
  import "../arrayExtensions-DlcBOj5a.js";
2
- import "../_styles.flight-booking-CaUgKcMC.js";
2
+ import "../keys-BcBfU51M.js";
3
3
  import "react";
4
- import { m as F, k as j, l as k, h as q, j as w, n as A, p as D } from "../noRetryInstance-Bit3xLkY.js";
4
+ import { m as j, k, l as q, h as w, j as A, n as D, p as E } from "../noRetryInstance-C4bqpBc7.js";
5
5
  import "../configs/baseUrl.js";
6
6
  import "../configs/endpoints.js";
7
7
  import "../configs/gatewayBaseUrl.js";
8
8
  import "@tanstack/react-query";
9
9
  import "react/jsx-runtime";
10
10
  import "react-i18next";
11
- import '../assets/_styles3.css';import '../assets/_styles5.css';import '../assets/_styles4.css';import '../assets/_styles.css';import '../assets/_styles2.css';/* empty css */
11
+ import '../assets/_styles4.css';import '../assets/_styles6.css';import '../assets/_styles5.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles3.css';/* empty css */
12
+ /* empty css */
12
13
  /* empty css */
13
14
  /* empty css */
14
15
  /* empty css */
@@ -18,11 +19,11 @@ import "../context/AwayzContext.js";
18
19
  import "../configs/awayzClient.js";
19
20
  import "../types/EAuthFlow.js";
20
21
  export {
21
- F as authFailurePostMessage,
22
- j as delay,
23
- k as executeWithDelay,
24
- q as getClientConfig,
25
- w as getGatewayConfig,
26
- A as handleAxiosError,
27
- D as processFailedRequests
22
+ j as authFailurePostMessage,
23
+ k as delay,
24
+ q as executeWithDelay,
25
+ w as getClientConfig,
26
+ A as getGatewayConfig,
27
+ D as handleAxiosError,
28
+ E as processFailedRequests
28
29
  };
@@ -1,4 +1,4 @@
1
- import { a } from "../noRetryInstance-Bit3xLkY.js";
1
+ import { a } from "../noRetryInstance-C4bqpBc7.js";
2
2
  export {
3
3
  a as clientNoRetryInstance
4
4
  };
@@ -2,7 +2,7 @@ var a = Object.defineProperty;
2
2
  var o = (s, e, r) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
3
3
  var n = (s, e, r) => o(s, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { EPreferencesEndpoints as u } from "../../configs/endpoints.js";
5
- import { c as i } from "../../noRetryInstance-Bit3xLkY.js";
5
+ import { c as i } from "../../noRetryInstance-C4bqpBc7.js";
6
6
  class E {
7
7
  constructor() {
8
8
  n(this, "setCurrency", async (e) => {
@@ -2,7 +2,7 @@ var s = Object.defineProperty;
2
2
  var n = (t, e, a) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
3
  var r = (t, e, a) => n(t, typeof e != "symbol" ? e + "" : e, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as o, b as c } from "../../noRetryInstance-Bit3xLkY.js";
5
+ import { c as o, b as c } from "../../noRetryInstance-C4bqpBc7.js";
6
6
  import "react";
7
7
  import { ERewardsEndpoints as i } from "../../configs/endpoints.js";
8
8
  class m {
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import "../../noRetryInstance-Bit3xLkY.js";
3
- import { T } from "../../TripsService-k5PnDpcP.js";
2
+ import "../../noRetryInstance-C4bqpBc7.js";
3
+ import { T } from "../../TripsService-fNtCUyxa.js";
4
4
  import "react";
5
5
  import "../../configs/defaultAwayzConfig.js";
6
6
  import "../../configs/endpoints.js";
@@ -2,7 +2,7 @@ var o = Object.defineProperty;
2
2
  var i = (d, a, t) => a in d ? o(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
3
3
  var r = (d, a, t) => i(d, typeof a != "symbol" ? a + "" : a, t);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as e, b as c, g as A } from "../../noRetryInstance-Bit3xLkY.js";
5
+ import { c as e, b as c, g as A } from "../../noRetryInstance-C4bqpBc7.js";
6
6
  import "react";
7
7
  import { EWalletEndpoints as s } from "../../configs/endpoints.js";
8
8
  class u {