@odynn/awayz-flights 0.9.6 → 0.9.8
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.
- package/dist/BookingOption-V-FzaupW.js +196 -0
- package/dist/FlightItinerary-C4KPpVcF.js +94 -0
- package/dist/_commonjsHelpers-MdHo5S7N.js +26 -0
- package/dist/{arrayExtensions-DFLvtO8l.js → arrayExtensions-Ce8YopTP.js} +92 -113
- package/dist/assets/FlightItinerary.css +1 -1
- package/dist/assets/FlightItineraryDropdown.css +1 -1
- package/dist/assets/_styles.css +1 -1
- package/dist/assets/_styles2.css +1 -1
- package/dist/assets/_styles3.css +1 -0
- package/dist/assets/_styles4.css +1 -0
- package/dist/components/BookingOption/BookingOption.js +5 -6
- package/dist/components/Dialog/Dialog.js +20542 -0
- package/dist/components/FlightItinerary/FlightItinerary.js +5 -6
- package/dist/components/FlightItineraryDropdown/FlightItineraryDropdown.js +23 -29
- package/dist/components/FlightResult/FlightResult.js +318 -284
- package/dist/components/HorizontalScroller/HorizontalScroller.js +4 -4
- package/dist/components/MiniFlightItinerary/MiniFlightItinerary.js +90 -7
- package/dist/components/index.js +5 -5
- package/dist/constants/endpoints.js +1 -1
- package/dist/{dateUtils-CWDSSY2R.js → dateUtils-Cb9VQiIL.js} +1 -1
- package/dist/enums-tLvxh02p.js +4 -0
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/useAirportSearch/useAirportSearch.js +1 -1
- package/dist/hooks/useFlightSearch/useFlightSearch.js +422 -12
- package/dist/{index-nOT-DH7g.js → index-9LVJi5JO.js} +12 -8
- package/dist/index-Kopwbl-x.js +19 -0
- package/dist/lib/components/Dialog/Dialog.d.ts +9 -0
- package/dist/lib/components/FlightItinerary/FlightItinerary.d.ts +1 -6
- package/dist/lib/components/FlightItineraryDropdown/FlightItineraryDropdown.d.ts +2 -4
- package/dist/lib/components/FlightResult/FlightResult.d.ts +1 -1
- package/dist/lib/constants/endpoints.d.ts +2 -1
- package/dist/lib/hooks/useFlightSearch/useFlightSearch.types.d.ts +3 -2
- package/dist/lib/services/flights/FlightsService.d.ts +1 -0
- package/dist/main.js +36 -35
- package/dist/services/flights/FlightsService.js +38 -29
- package/dist/services/wallet/WalletService.js +1 -1
- package/dist/utils/flightUtils.js +27 -28
- package/package.json +2 -1
- package/dist/BookingOption-Bf4d2RKS.js +0 -192
- package/dist/FlightItinerary-C2Jp2a9c.js +0 -262
- package/dist/MiniFlightItinerary-BEdrqoGh.js +0 -105
- package/dist/index-Gj4bRuCQ.js +0 -15
- package/dist/index-nI16-czT.js +0 -4
- package/dist/useFlightSearch-C0DEmnCL.js +0 -412
|
@@ -1,384 +1,418 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useAwayzContext as
|
|
3
|
-
import { useQuery as
|
|
4
|
-
import { p as
|
|
5
|
-
import { g as
|
|
6
|
-
import "../../arrayExtensions-
|
|
7
|
-
import { E as
|
|
8
|
-
import {
|
|
9
|
-
import { useState as
|
|
10
|
-
import { h as
|
|
11
|
-
import { useTranslation as
|
|
12
|
-
import {
|
|
13
|
-
import { EPaymentType as
|
|
14
|
-
import { DEFAULT_AIRLINE_PROGRAM as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsx as r, jsxs as n, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { useAwayzContext as Fe, useFeatureFlags as Pe, RewardsService as Y, EAmountsDisplayFeature as u, CashValue as Q, EToolTipPosition as j, ClientPointsValue as Ee, EInvalidAmountDisplayOption as Te, awayzClient as ne, EFlightBookingOptionsDisplayFeature as G, CurrencyService as Ae } from "@odynn/awayz-core";
|
|
3
|
+
import { useQuery as De } from "@tanstack/react-query";
|
|
4
|
+
import { p as w, c as Oe, B as J } from "../../BookingOption-V-FzaupW.js";
|
|
5
|
+
import { g as X } from "../../dateUtils-Cb9VQiIL.js";
|
|
6
|
+
import "../../arrayExtensions-Ce8YopTP.js";
|
|
7
|
+
import { E as H } from "../../enums-tLvxh02p.js";
|
|
8
|
+
import { E as T, F as Z } from "../../FlightItinerary-C4KPpVcF.js";
|
|
9
|
+
import { useRef as be, useState as A, useMemo as v, useEffect as k } from "react";
|
|
10
|
+
import { h as g } from "../../moment-BGjjqtLQ.js";
|
|
11
|
+
import { useTranslation as Ce } from "react-i18next";
|
|
12
|
+
import { b as W, c as _e, d as Se, e as Ie, f as x } from "../../index-9LVJi5JO.js";
|
|
13
|
+
import { EPaymentType as d } from "../../enums/EPaymentType.js";
|
|
14
|
+
import { DEFAULT_AIRLINE_PROGRAM as B, getFlightNumber as Re, getLogoPath as Le, getAirlineProgram as ke } from "../../utils/flightUtils.js";
|
|
15
|
+
import ee from "../Dialog/Dialog.js";
|
|
16
|
+
import ie from "../HorizontalScroller/HorizontalScroller.js";
|
|
17
|
+
import '../../assets/_styles.css';/* empty css */
|
|
18
|
+
const xe = (...e) => e.join(" ");
|
|
19
|
+
async function re(e, h, l) {
|
|
20
|
+
if (!e || h === l) return e;
|
|
21
|
+
const t = await ne.ensureQueryData({
|
|
22
|
+
queryKey: [H.CONVERT_CURRENCY, h, l],
|
|
21
23
|
staleTime: 1e3 * 60 * 60,
|
|
22
24
|
// 1 hour
|
|
23
|
-
queryFn: () =>
|
|
24
|
-
baseCurrency:
|
|
25
|
-
targetCurrency:
|
|
25
|
+
queryFn: () => Ae.convertCurrency({
|
|
26
|
+
baseCurrency: h,
|
|
27
|
+
targetCurrency: l
|
|
26
28
|
})
|
|
27
29
|
});
|
|
28
|
-
return
|
|
30
|
+
return e * t;
|
|
29
31
|
}
|
|
30
|
-
const
|
|
31
|
-
details:
|
|
32
|
-
onClick:
|
|
33
|
-
showBestValue:
|
|
34
|
-
onShowBestValueCalculation:
|
|
35
|
-
customStyling:
|
|
36
|
-
customCashComponent:
|
|
37
|
-
customPointsComponent:
|
|
38
|
-
onBookWithCash:
|
|
39
|
-
onBookWithPoints:
|
|
32
|
+
const Be = ({
|
|
33
|
+
details: e,
|
|
34
|
+
onClick: h,
|
|
35
|
+
showBestValue: l = !1,
|
|
36
|
+
onShowBestValueCalculation: t,
|
|
37
|
+
customStyling: se = !1,
|
|
38
|
+
customCashComponent: ae,
|
|
39
|
+
customPointsComponent: te,
|
|
40
|
+
onBookWithCash: D,
|
|
41
|
+
onBookWithPoints: O
|
|
40
42
|
}) => {
|
|
41
|
-
const { t:
|
|
43
|
+
const { t: N } = Ce(), b = be(null), [U, ce] = A(!1), [F, le] = A(
|
|
42
44
|
"none"
|
|
43
45
|
/* NONE */
|
|
44
|
-
), [
|
|
45
|
-
() =>
|
|
46
|
-
[
|
|
47
|
-
),
|
|
48
|
-
() =>
|
|
49
|
-
[
|
|
50
|
-
),
|
|
51
|
-
var
|
|
52
|
-
return
|
|
53
|
-
(s) => s.program ===
|
|
54
|
-
) ||
|
|
55
|
-
}, [
|
|
56
|
-
if (!
|
|
57
|
-
|
|
46
|
+
), [oe, me] = A(!1), { config: C } = Fe(), pe = e.origin, he = e.destination, P = e.flightDetails, m = e.paymentOptions || [], { featureFlags: p } = Pe(), _ = v(
|
|
47
|
+
() => m.filter((i) => i.points === -1),
|
|
48
|
+
[m]
|
|
49
|
+
), S = v(
|
|
50
|
+
() => m.filter((i) => i.points > -1),
|
|
51
|
+
[m]
|
|
52
|
+
), $ = m.filter((i) => i.points === -1).length === 1, ge = m.filter((i) => i.points > -1).length === 1, [fe, M] = A(B), c = v(() => {
|
|
53
|
+
var i = m.filter((s) => s.points > -1).sort((s, a) => s.points - a.points);
|
|
54
|
+
return i.find(
|
|
55
|
+
(s) => s.program === e.airlineProgram
|
|
56
|
+
) || i[0];
|
|
57
|
+
}, [m, e.airlineProgram]), ue = async () => {
|
|
58
|
+
if (!c) {
|
|
59
|
+
M(B);
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
+
const i = await ke(c.program);
|
|
63
|
+
M(i);
|
|
62
64
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
const { flightNumbers:
|
|
67
|
-
const
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
s.some((
|
|
74
|
-
logo:
|
|
75
|
-
airline:
|
|
65
|
+
k(() => {
|
|
66
|
+
ue();
|
|
67
|
+
}, [c]);
|
|
68
|
+
const { flightNumbers: de, airlines: y } = v(() => {
|
|
69
|
+
const i = [], s = [];
|
|
70
|
+
return e.flightDetails.slices.forEach((a) => {
|
|
71
|
+
a.segments.forEach((o) => {
|
|
72
|
+
const f = Re(o);
|
|
73
|
+
i.includes(f) || i.push(f);
|
|
74
|
+
const E = o.operatingCarrier;
|
|
75
|
+
s.some((R) => R.airline === E.name) || s.push({
|
|
76
|
+
logo: Le(E.iataCode),
|
|
77
|
+
airline: E.name
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
|
-
}), { flightNumbers:
|
|
79
|
-
}, [
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
queryKey: [
|
|
83
|
-
queryFn: () =>
|
|
80
|
+
}), { flightNumbers: i, airlines: s };
|
|
81
|
+
}, [e.flightDetails.slices]), Ne = () => {
|
|
82
|
+
p.flightBookingOptionsDisplayFeature === G.SHEET || e.partial ? e.cash > 0 ? h(e, d.CASH) : h(e, d.POINTS) : K();
|
|
83
|
+
}, I = e == null ? void 0 : e.airlineProgram, { data: V } = De({
|
|
84
|
+
queryKey: [H.VALUE_CENTS, I, "test"],
|
|
85
|
+
queryFn: () => Y.getCentPerPoint(I),
|
|
84
86
|
staleTime: 1 / 0,
|
|
85
|
-
enabled: !!
|
|
86
|
-
}), q =
|
|
87
|
-
var
|
|
88
|
-
return (s = (
|
|
89
|
-
(
|
|
90
|
-
var
|
|
91
|
-
return
|
|
87
|
+
enabled: !!I && l
|
|
88
|
+
}), q = v(() => {
|
|
89
|
+
var i, s;
|
|
90
|
+
return (s = (i = e.paymentOptions) == null ? void 0 : i.find(
|
|
91
|
+
(a) => {
|
|
92
|
+
var o;
|
|
93
|
+
return a.program === e.airlineProgram && ((o = a.cashFee) == null ? void 0 : o.amount) !== 0;
|
|
92
94
|
}
|
|
93
95
|
)) == null ? void 0 : s.cashFee;
|
|
94
|
-
}, [
|
|
95
|
-
if (!
|
|
96
|
+
}, [e.paymentOptions, e.airlineProgram]), ye = async () => {
|
|
97
|
+
if (!e || !V || !e.points || !e.cash)
|
|
96
98
|
return;
|
|
97
|
-
const
|
|
99
|
+
const i = e.currency;
|
|
98
100
|
let s = {
|
|
99
101
|
valueCents: 1,
|
|
100
|
-
currency:
|
|
102
|
+
currency: i
|
|
101
103
|
};
|
|
102
104
|
try {
|
|
103
|
-
s = await
|
|
104
|
-
queryKey: [
|
|
105
|
+
s = await ne.ensureQueryData({
|
|
106
|
+
queryKey: [H.VALUE_CENTS, e.airlineProgram],
|
|
105
107
|
staleTime: 1e3 * 60 * 60,
|
|
106
108
|
// 1 hour
|
|
107
|
-
queryFn: () =>
|
|
109
|
+
queryFn: () => Y.getCentPerPoint(e.airlineProgram)
|
|
108
110
|
});
|
|
109
|
-
} catch (
|
|
111
|
+
} catch (ve) {
|
|
110
112
|
console.warn(
|
|
111
113
|
"Failed to fetch value cents for airline program:",
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
e.airlineProgram,
|
|
115
|
+
ve
|
|
114
116
|
);
|
|
115
117
|
}
|
|
116
|
-
const
|
|
118
|
+
const a = q ?? {
|
|
117
119
|
amount: 0,
|
|
118
|
-
currency:
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
currency: i
|
|
121
|
+
}, [o, f] = await Promise.all([
|
|
122
|
+
re(
|
|
123
|
+
a.amount,
|
|
124
|
+
a.currency,
|
|
125
|
+
i
|
|
124
126
|
),
|
|
125
|
-
|
|
127
|
+
re(
|
|
126
128
|
s.valueCents,
|
|
127
129
|
s.currency,
|
|
128
|
-
|
|
130
|
+
i
|
|
129
131
|
)
|
|
130
|
-
]),
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
]), R = f * e.points / 100 + o < e.cash;
|
|
133
|
+
le(
|
|
134
|
+
R ? "points" : "cash"
|
|
133
135
|
/* CASH */
|
|
134
136
|
);
|
|
135
137
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
const
|
|
140
|
-
if (!(
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
},
|
|
138
|
+
k(() => {
|
|
139
|
+
ye();
|
|
140
|
+
}, [e, V, q]), k(() => {
|
|
141
|
+
const i = g(e.expiresAt), s = g();
|
|
142
|
+
if (!(i.year() === g(0).year()) && i.isAfter(s)) {
|
|
143
|
+
const o = i.diff(s), f = setTimeout(() => {
|
|
144
|
+
me(!0);
|
|
145
|
+
}, o);
|
|
144
146
|
return () => {
|
|
145
|
-
clearTimeout(
|
|
147
|
+
clearTimeout(f);
|
|
146
148
|
};
|
|
147
149
|
}
|
|
148
|
-
}, [
|
|
149
|
-
const
|
|
150
|
-
|
|
150
|
+
}, [e.expiresAt]);
|
|
151
|
+
const z = (i, s, a) => {
|
|
152
|
+
i.stopPropagation(), p.flightBookingOptionsDisplayFeature === G.SHEET || a.partial ? h(a, s) : K();
|
|
153
|
+
}, K = () => {
|
|
154
|
+
const i = !U;
|
|
155
|
+
ce(i), i && b.current && b.current.scrollIntoView({ behavior: "smooth" });
|
|
151
156
|
};
|
|
152
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ r(
|
|
153
158
|
"div",
|
|
154
159
|
{
|
|
155
|
-
className: `${
|
|
156
|
-
onClick:
|
|
160
|
+
className: `${se ? "" : "awayz-"}flight-result`,
|
|
161
|
+
onClick: Ne,
|
|
157
162
|
children: /* @__PURE__ */ n("div", { className: "content", children: [
|
|
158
163
|
/* @__PURE__ */ n("div", { className: "flight-info", children: [
|
|
159
164
|
/* @__PURE__ */ n("div", { className: "flight-info-header", children: [
|
|
160
165
|
/* @__PURE__ */ n("div", { className: "airline-logo", children: [
|
|
161
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ r(
|
|
162
167
|
"img",
|
|
163
168
|
{
|
|
164
|
-
src:
|
|
165
|
-
alt:
|
|
166
|
-
onError: (
|
|
169
|
+
src: y[0].logo,
|
|
170
|
+
alt: y[0].airline,
|
|
171
|
+
onError: (i) => i.currentTarget.src = (C == null ? void 0 : C.logoFallbackImageUrl) ?? ""
|
|
167
172
|
}
|
|
168
173
|
),
|
|
169
174
|
/* @__PURE__ */ n("div", { children: [
|
|
170
175
|
/* @__PURE__ */ n("p", { children: [
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
y[0].airline,
|
|
177
|
+
y.length > 1 && /* @__PURE__ */ n("sup", { className: "multiple-airlines", children: [
|
|
173
178
|
"+",
|
|
174
|
-
|
|
179
|
+
y.length - 1
|
|
175
180
|
] })
|
|
176
181
|
] }),
|
|
177
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ r("p", { children: de[0] })
|
|
178
183
|
] })
|
|
179
184
|
] }),
|
|
180
185
|
/* @__PURE__ */ n("div", { className: "flight-times", children: [
|
|
181
186
|
/* @__PURE__ */ n("div", { className: "flight-duration", children: [
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ r(W, {}),
|
|
188
|
+
/* @__PURE__ */ r("p", { children: X(P.slices[0].duration) })
|
|
184
189
|
] }),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
190
|
+
/* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${w(
|
|
191
|
+
e.numberOfStops,
|
|
187
192
|
"Stop"
|
|
188
193
|
)}` : "Direct" })
|
|
189
194
|
] })
|
|
190
195
|
] }),
|
|
191
196
|
/* @__PURE__ */ n("div", { className: "flight-info-content", children: [
|
|
192
197
|
/* @__PURE__ */ n("div", { className: "flight-info-times", children: [
|
|
198
|
+
/* @__PURE__ */ r("p", { className: "flight-info-date", children: g(e.departureTime).format(
|
|
199
|
+
N(T.DISPLAY_MEDIUM)
|
|
200
|
+
) }),
|
|
193
201
|
/* @__PURE__ */ n("p", { className: "flight-info-time", children: [
|
|
194
|
-
|
|
195
|
-
|
|
202
|
+
g(e.departureTime).format(
|
|
203
|
+
N(T.TIME_ONLY)
|
|
196
204
|
),
|
|
197
205
|
" "
|
|
198
206
|
] }),
|
|
199
|
-
/* @__PURE__ */ i("div", {}),
|
|
200
207
|
/* @__PURE__ */ n("div", { className: "flight-location", children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(_e, {}) }),
|
|
209
|
+
/* @__PURE__ */ r("p", { children: pe.airportCode })
|
|
203
210
|
] })
|
|
204
211
|
] }),
|
|
205
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ n("div", { className: "flight-icon", children: [
|
|
213
|
+
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(Se, {}) }),
|
|
214
|
+
/* @__PURE__ */ n("div", { className: "flight-times", children: [
|
|
215
|
+
/* @__PURE__ */ n("div", { className: "flight-duration", children: [
|
|
216
|
+
/* @__PURE__ */ r(W, {}),
|
|
217
|
+
/* @__PURE__ */ r("p", { children: X(P.slices[0].duration) })
|
|
218
|
+
] }),
|
|
219
|
+
/* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${w(
|
|
220
|
+
e.numberOfStops,
|
|
221
|
+
"Stop"
|
|
222
|
+
)}` : "Direct" })
|
|
223
|
+
] }),
|
|
224
|
+
/* @__PURE__ */ r(
|
|
225
|
+
ee,
|
|
226
|
+
{
|
|
227
|
+
title: "Flight Details",
|
|
228
|
+
trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "Flight Details" }),
|
|
229
|
+
children: /* @__PURE__ */ r(Z, { itinerary: P.slices[0].segments })
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
] }),
|
|
206
233
|
/* @__PURE__ */ n("div", { className: "flight-info-times", children: [
|
|
234
|
+
/* @__PURE__ */ r("p", { className: "flight-info-date", children: g(e.arrivalTime).format(
|
|
235
|
+
N(T.DISPLAY_MEDIUM)
|
|
236
|
+
) }),
|
|
207
237
|
/* @__PURE__ */ n("p", { className: "flight-info-time", children: [
|
|
208
|
-
|
|
209
|
-
|
|
238
|
+
g(e.arrivalTime).format(
|
|
239
|
+
N(T.TIME_ONLY)
|
|
210
240
|
),
|
|
211
241
|
" "
|
|
212
242
|
] }),
|
|
213
243
|
/* @__PURE__ */ n("div", { className: "flight-location", children: [
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ r("p", { children: he.airportCode }),
|
|
245
|
+
/* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(Ie, {}) })
|
|
216
246
|
] })
|
|
217
247
|
] })
|
|
218
248
|
] })
|
|
219
249
|
] }),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
|
|
223
|
-
] }) : /* @__PURE__ */ n(S, { children: [
|
|
224
|
-
W || r.cash > 0 && /* @__PURE__ */ n(
|
|
225
|
-
"div",
|
|
250
|
+
/* @__PURE__ */ n("div", { className: "flight-footer", children: [
|
|
251
|
+
/* @__PURE__ */ r(
|
|
252
|
+
ee,
|
|
226
253
|
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
children: [
|
|
232
|
-
g.amountsDisplayFeature === F.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ i("b", { children: "Cash" }),
|
|
233
|
-
/* @__PURE__ */ n("div", { children: [
|
|
234
|
-
/* @__PURE__ */ i("label", { children: ae ? "Book For" : "From" }),
|
|
235
|
-
/* @__PURE__ */ n("span", { className: "flight-cash-amount-value", children: [
|
|
236
|
-
/* @__PURE__ */ i(
|
|
237
|
-
K,
|
|
238
|
-
{
|
|
239
|
-
amount: r.cash,
|
|
240
|
-
currency: r.currency,
|
|
241
|
-
position: Q.LEFT
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
g.amountsDisplayFeature === F.CASH_AND_CLIENT_POINTS && /* @__PURE__ */ n(S, { children: [
|
|
245
|
-
"/",
|
|
246
|
-
" ",
|
|
247
|
-
/* @__PURE__ */ i(
|
|
248
|
-
ue,
|
|
249
|
-
{
|
|
250
|
-
currency: r.currency,
|
|
251
|
-
cashAmount: r.cash
|
|
252
|
-
}
|
|
253
|
-
)
|
|
254
|
-
] })
|
|
255
|
-
] })
|
|
256
|
-
] }),
|
|
257
|
-
N === "cash" && g.amountsDisplayFeature === F.CASH_AND_TRAVEL_PARTNER_POINTS && o && /* @__PURE__ */ n(
|
|
258
|
-
"div",
|
|
259
|
-
{
|
|
260
|
-
className: "best-value-flag tip",
|
|
261
|
-
onClick: (e) => {
|
|
262
|
-
e.stopPropagation(), a == null || a(r);
|
|
263
|
-
},
|
|
264
|
-
children: [
|
|
265
|
-
a && /* @__PURE__ */ i(R, {}),
|
|
266
|
-
/* @__PURE__ */ i("p", { children: "Best Value" }),
|
|
267
|
-
a && /* @__PURE__ */ i("span", { children: "Click to learn more" })
|
|
268
|
-
]
|
|
269
|
-
}
|
|
270
|
-
)
|
|
271
|
-
]
|
|
254
|
+
title: "Flight Details",
|
|
255
|
+
trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "View Flight Details" }),
|
|
256
|
+
children: /* @__PURE__ */ r(Z, { itinerary: P.slices[0].segments })
|
|
272
257
|
}
|
|
273
258
|
),
|
|
274
|
-
|
|
275
|
-
"
|
|
276
|
-
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
"
|
|
284
|
-
|
|
285
|
-
className: "best-value-flag tip",
|
|
286
|
-
onClick: (e) => {
|
|
287
|
-
e.stopPropagation(), a == null || a(r);
|
|
288
|
-
},
|
|
289
|
-
children: [
|
|
290
|
-
a && /* @__PURE__ */ i(R, {}),
|
|
291
|
-
/* @__PURE__ */ i("p", { children: "Best Value" }),
|
|
292
|
-
a && /* @__PURE__ */ i("span", { children: "Click to learn more" })
|
|
293
|
-
]
|
|
294
|
-
}
|
|
259
|
+
/* @__PURE__ */ r("div", { className: "booking-options", children: oe ? /* @__PURE__ */ n("div", { className: "offer-expiry", children: [
|
|
260
|
+
/* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(x, {}) }),
|
|
261
|
+
/* @__PURE__ */ r("p", { className: "expired-tip", children: "Offer Expired" })
|
|
262
|
+
] }) : /* @__PURE__ */ n(L, { children: [
|
|
263
|
+
ae || e.cash > 0 && /* @__PURE__ */ n(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
className: xe(
|
|
267
|
+
"amount-value",
|
|
268
|
+
F === "cash" && l ? "show-best-value-flag" : "",
|
|
269
|
+
p.amountsDisplayFeature !== u.CASH_AND_TRAVEL_PARTNER_POINTS ? "lg" : ""
|
|
295
270
|
),
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
K,
|
|
271
|
+
onClick: (i) => {
|
|
272
|
+
z(i, d.CASH, e);
|
|
273
|
+
},
|
|
274
|
+
children: [
|
|
275
|
+
p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS ? /* @__PURE__ */ r("b", { children: "Cash" }) : /* @__PURE__ */ r("b", { children: $ ? "Book For" : "From" }),
|
|
276
|
+
/* @__PURE__ */ n("div", { children: [
|
|
277
|
+
p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ r("label", { children: $ ? "Book For" : "From" }),
|
|
278
|
+
/* @__PURE__ */ n("span", { className: "flight-cash-amount-value", children: [
|
|
279
|
+
/* @__PURE__ */ r(
|
|
280
|
+
Q,
|
|
307
281
|
{
|
|
308
|
-
amount:
|
|
309
|
-
currency:
|
|
310
|
-
|
|
311
|
-
zeroDisplayOption: de.CUSTOM,
|
|
312
|
-
position: Q.LEFT
|
|
282
|
+
amount: e.cash,
|
|
283
|
+
currency: e.currency,
|
|
284
|
+
position: j.LEFT
|
|
313
285
|
}
|
|
314
|
-
)
|
|
286
|
+
),
|
|
287
|
+
p.amountsDisplayFeature === u.CASH_AND_CLIENT_POINTS && /* @__PURE__ */ n(L, { children: [
|
|
288
|
+
"/",
|
|
289
|
+
" ",
|
|
290
|
+
/* @__PURE__ */ r(
|
|
291
|
+
Ee,
|
|
292
|
+
{
|
|
293
|
+
currency: e.currency,
|
|
294
|
+
cashAmount: e.cash
|
|
295
|
+
}
|
|
296
|
+
)
|
|
297
|
+
] })
|
|
298
|
+
] })
|
|
299
|
+
] }),
|
|
300
|
+
F === "cash" && p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && l && /* @__PURE__ */ n(
|
|
301
|
+
"div",
|
|
302
|
+
{
|
|
303
|
+
className: "best-value-flag tip",
|
|
304
|
+
onClick: (i) => {
|
|
305
|
+
i.stopPropagation(), t == null || t(e);
|
|
306
|
+
},
|
|
307
|
+
children: [
|
|
308
|
+
t && /* @__PURE__ */ r(x, {}),
|
|
309
|
+
/* @__PURE__ */ r("p", { children: "Best Value" }),
|
|
310
|
+
t && /* @__PURE__ */ r("span", { children: "Click to learn more" })
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
te || e.points > 0 && p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ n(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
className: `amount-value ${F === "points" && l ? "show-best-value-flag" : ""}`,
|
|
321
|
+
onClick: (i) => {
|
|
322
|
+
z(i, d.POINTS, e);
|
|
323
|
+
},
|
|
324
|
+
children: [
|
|
325
|
+
F === "points" && l && /* @__PURE__ */ n(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
className: "best-value-flag tip",
|
|
329
|
+
onClick: (i) => {
|
|
330
|
+
i.stopPropagation(), t == null || t(e);
|
|
331
|
+
},
|
|
332
|
+
children: [
|
|
333
|
+
t && /* @__PURE__ */ r(x, {}),
|
|
334
|
+
/* @__PURE__ */ r("p", { children: "Best Value" }),
|
|
335
|
+
t && /* @__PURE__ */ r("span", { children: "Click to learn more" })
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
/* @__PURE__ */ r("div", { className: "amount-airline-logo", children: /* @__PURE__ */ r("img", { src: fe.programLogo }) }),
|
|
340
|
+
/* @__PURE__ */ n("div", { children: [
|
|
341
|
+
/* @__PURE__ */ r("label", { children: ge ? "Book For" : "From" }),
|
|
342
|
+
/* @__PURE__ */ n("p", { children: [
|
|
343
|
+
`${Oe(
|
|
344
|
+
c == null ? void 0 : c.points
|
|
345
|
+
)} ${N("miles")}`,
|
|
346
|
+
!!(c != null && c.cashFee) && /* @__PURE__ */ n(L, { children: [
|
|
347
|
+
" + ",
|
|
348
|
+
/* @__PURE__ */ r(
|
|
349
|
+
Q,
|
|
350
|
+
{
|
|
351
|
+
amount: c.cashFee.amount,
|
|
352
|
+
currency: c.cashFee.currency,
|
|
353
|
+
customDisplay: "No fee",
|
|
354
|
+
zeroDisplayOption: Te.CUSTOM,
|
|
355
|
+
position: j.LEFT
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
] })
|
|
315
359
|
] })
|
|
316
360
|
] })
|
|
317
|
-
]
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
)
|
|
321
|
-
] })
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
|
|
325
|
-
{
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
D.length > 0 && /* @__PURE__ */ i("p", { className: "booking-options-title", children: "Cash Options" }),
|
|
334
|
-
/* @__PURE__ */ i(J, { children: C.map((e, s) => /* @__PURE__ */ i(
|
|
335
|
-
Y,
|
|
336
|
-
{
|
|
337
|
-
type: f.CASH,
|
|
338
|
-
title: e.fareBrandName,
|
|
339
|
-
cashValue: {
|
|
340
|
-
amount: e.cash,
|
|
341
|
-
currency: r.currency
|
|
342
|
-
},
|
|
343
|
-
milesValue: void 0,
|
|
344
|
-
cashFee: e.cashFee,
|
|
345
|
-
setSelected: () => {
|
|
346
|
-
E == null || E(e);
|
|
347
|
-
},
|
|
348
|
-
conditions: e.conditions,
|
|
349
|
-
slices: r.flightDetails.slices,
|
|
350
|
-
baggages: e.baggages
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
)
|
|
364
|
+
] }) })
|
|
365
|
+
] }),
|
|
366
|
+
/* @__PURE__ */ r("div", { className: `flight-details ${U ? "is-open" : ""}`, children: /* @__PURE__ */ r("div", { ref: b, className: "inner", children: /* @__PURE__ */ n("div", { className: "flight-booking-options", children: [
|
|
367
|
+
_.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
|
|
368
|
+
S.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Cash Options" }),
|
|
369
|
+
/* @__PURE__ */ r(ie, { children: _.map((i, s) => /* @__PURE__ */ r(
|
|
370
|
+
J,
|
|
371
|
+
{
|
|
372
|
+
type: d.CASH,
|
|
373
|
+
title: i.fareBrandName,
|
|
374
|
+
cashValue: {
|
|
375
|
+
amount: i.cash,
|
|
376
|
+
currency: e.currency
|
|
351
377
|
},
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
C.length > 0 && /* @__PURE__ */ i("p", { className: "booking-options-title", children: "Miles Options" }),
|
|
357
|
-
/* @__PURE__ */ i(J, { children: D.map((e, s) => /* @__PURE__ */ i(
|
|
358
|
-
Y,
|
|
359
|
-
{
|
|
360
|
-
type: f.POINTS,
|
|
361
|
-
title: e.fareBrandName,
|
|
362
|
-
cashValue: void 0,
|
|
363
|
-
milesValue: e.points,
|
|
364
|
-
cashFee: e.cashFee,
|
|
365
|
-
setSelected: () => {
|
|
366
|
-
T == null || T(e);
|
|
367
|
-
},
|
|
368
|
-
conditions: e.conditions,
|
|
369
|
-
slices: r.flightDetails.slices,
|
|
370
|
-
baggages: e.baggages,
|
|
371
|
-
program: e.program
|
|
378
|
+
milesValue: void 0,
|
|
379
|
+
cashFee: i.cashFee,
|
|
380
|
+
setSelected: () => {
|
|
381
|
+
D == null || D(i, e);
|
|
372
382
|
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
383
|
+
conditions: i.conditions,
|
|
384
|
+
slices: e.flightDetails.slices,
|
|
385
|
+
baggages: i.baggages
|
|
386
|
+
},
|
|
387
|
+
`cash-${s}`
|
|
388
|
+
)) })
|
|
389
|
+
] }),
|
|
390
|
+
S.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
|
|
391
|
+
_.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Miles Options" }),
|
|
392
|
+
/* @__PURE__ */ r(ie, { children: S.map((i, s) => /* @__PURE__ */ r(
|
|
393
|
+
J,
|
|
394
|
+
{
|
|
395
|
+
type: d.POINTS,
|
|
396
|
+
title: i.fareBrandName,
|
|
397
|
+
cashValue: void 0,
|
|
398
|
+
milesValue: i.points,
|
|
399
|
+
cashFee: i.cashFee,
|
|
400
|
+
setSelected: () => {
|
|
401
|
+
O == null || O(i);
|
|
402
|
+
},
|
|
403
|
+
conditions: i.conditions,
|
|
404
|
+
slices: e.flightDetails.slices,
|
|
405
|
+
baggages: i.baggages,
|
|
406
|
+
program: i.program
|
|
407
|
+
},
|
|
408
|
+
`points-${s}`
|
|
409
|
+
)) })
|
|
376
410
|
] })
|
|
377
|
-
] }) })
|
|
411
|
+
] }) }) })
|
|
378
412
|
] })
|
|
379
413
|
}
|
|
380
414
|
);
|
|
381
415
|
};
|
|
382
416
|
export {
|
|
383
|
-
|
|
417
|
+
Be as FlightResult
|
|
384
418
|
};
|