@odynn/awayz-flights 0.5.7 → 0.5.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.
@@ -0,0 +1,260 @@
1
+ import { jsx as i, jsxs as s, Fragment as Y } from "react/jsx-runtime";
2
+ import { RewardsService as J, CashValue as A, EToolTipPosition as C, EInvalidAmountDisplayOption as W } from "@odynn/awayz-core";
3
+ import { useQuery as X } from "@tanstack/react-query";
4
+ import { g as Z } from "./index-7zRjF0bU.js";
5
+ import { G as w, g as I, a as d, E as N, F as V, b as B } from "./FlightItinerary-Dy-2zMYt.js";
6
+ import { E as rr } from "./enums-DxmoBOKL.js";
7
+ import "./arrayExtensions-DFLvtO8l.js";
8
+ import ir, { useState as M, useMemo as L } from "react";
9
+ import { h as u } from "./moment-BGjjqtLQ.js";
10
+ import { useTranslation as er } from "react-i18next";
11
+ import { EPaymentType as v } from "./enums/EPaymentType.js";
12
+ import { isSameDayFlight as sr } from "./utils/flightDateUtils.js";
13
+ import { DEFAULT_AIRLINE_PROGRAM as tr, getFlightNumber as ar, getFullLogoPath as nr, getLogoPath as or, getAirlineProgram as cr } from "./utils/flightUtils.js";
14
+ import './assets/FlightResult.css';const lr = (r, t, o = t + "s") => r === 1 ? t : o;
15
+ function mr(r) {
16
+ if (!r || isNaN(r) || r < 0) return "N/A";
17
+ let t = r == null ? void 0 : r.toString().split(".")[0];
18
+ return t == null ? void 0 : t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
19
+ }
20
+ function S(r) {
21
+ return w({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z" }, child: [] }] })(r);
22
+ }
23
+ const Er = ({
24
+ details: r,
25
+ onClick: t,
26
+ showBestValue: o = !1,
27
+ onShowBestValueCalculation: n,
28
+ customStyling: _ = !1
29
+ }) => {
30
+ const { t: c } = er(), [D, $] = M(!1), m = r.origin, p = r.destination, E = r.flightDetails, k = r.paymentOptions || [];
31
+ let O = r.airlineLogo;
32
+ const R = k.filter((e) => e.points === -1).length === 1, z = k.filter((e) => e.points > -1).length === 1, [U, x] = M(tr), G = async () => {
33
+ const e = await cr(r.airlineProgram);
34
+ x(e);
35
+ }, { flightNumbers: y, airlines: K } = L(() => {
36
+ const e = [], a = [];
37
+ return r.flightDetails.slices.forEach((g) => {
38
+ g.segments.forEach((f) => {
39
+ const l = ar(f);
40
+ e.includes(l) || e.push(l), O = nr(
41
+ f.marketingCarrier.iataCode
42
+ );
43
+ const T = f.operatingCarrier;
44
+ a.some((Q) => Q.airline === T.name) || a.push({
45
+ logo: or(T.iataCode),
46
+ airline: T.name
47
+ });
48
+ });
49
+ }), G(), { flightNumbers: e, airlines: a };
50
+ }, [r.flightDetails.slices]), j = () => {
51
+ r.cash > 0 ? t(r, v.CASH) : t(r, v.POINTS);
52
+ }, q = !sr(
53
+ r.departureTime,
54
+ r.arrivalTime
55
+ ), F = r == null ? void 0 : r.airlineProgram, { data: b } = X({
56
+ queryKey: [rr.VALUE_CENTS, F],
57
+ queryFn: () => J.getPointsPerCent(F ?? ""),
58
+ staleTime: 1 / 0,
59
+ placeholderData: 0,
60
+ enabled: !!F && o
61
+ }), H = () => {
62
+ var l;
63
+ if (!r || !b || !r.points || !r.cash)
64
+ return {
65
+ pointsCashValue: 0,
66
+ bestValueStatus: "none"
67
+ /* NONE */
68
+ };
69
+ const e = b * r.points / 100, a = ((l = r.cashFee) == null ? void 0 : l.amount) || 0;
70
+ return {
71
+ bestValueStatus: e + a < r.cash ? "points" : "cash"
72
+ /* CASH */
73
+ };
74
+ }, { bestValueStatus: h } = H(), P = L(() => {
75
+ var e, a;
76
+ return (a = (e = r.paymentOptions) == null ? void 0 : e.find(
77
+ (g) => g.program === r.airlineProgram
78
+ )) == null ? void 0 : a.cashFee;
79
+ }, [r.paymentOptions, r.airlineProgram]);
80
+ return /* @__PURE__ */ i(
81
+ "div",
82
+ {
83
+ className: `${_ ? "" : "awayz-"}flight-result`,
84
+ onClick: j,
85
+ children: /* @__PURE__ */ s("div", { className: "content", children: [
86
+ /* @__PURE__ */ i("div", { className: "flight-info", children: /* @__PURE__ */ s("div", { className: "flight-locations", children: [
87
+ /* @__PURE__ */ i("div", { className: "airlines", children: K.map((e, a) => /* @__PURE__ */ i(ir.Fragment, { children: /* @__PURE__ */ s("div", { className: "tip", children: [
88
+ /* @__PURE__ */ i("img", { src: e.logo, alt: e.airline }),
89
+ /* @__PURE__ */ i("span", { className: "right", children: e.airline })
90
+ ] }, a) }, a)) }),
91
+ /* @__PURE__ */ s("div", { className: "flight-location", children: [
92
+ /* @__PURE__ */ s("p", { className: "show-desktop", children: [
93
+ m.city,
94
+ ",",
95
+ I(m.country)
96
+ ] }),
97
+ /* @__PURE__ */ i("p", { className: "show-desktop", children: u(r.departureTime).format(
98
+ c(d.DATE_TIME_MEDIUM, N.FlightShortDate)
99
+ ) }),
100
+ /* @__PURE__ */ i("p", { className: "show-mobile", children: m.airportCode }),
101
+ /* @__PURE__ */ i("p", { className: "show-mobile", children: u(r.departureTime).format(
102
+ c(d.TIME_ONLY, N.FlightTime)
103
+ ) })
104
+ ] }),
105
+ /* @__PURE__ */ s("div", { className: "flight-duration", children: [
106
+ /* @__PURE__ */ i("span", { className: "line" }),
107
+ /* @__PURE__ */ s("p", { children: [
108
+ Z(E.slices[0].duration),
109
+ " ",
110
+ " - ",
111
+ r.numberOfStops > 0 ? `${r.numberOfStops} ${lr(
112
+ r.numberOfStops,
113
+ "Stop"
114
+ )}` : "Direct"
115
+ ] }),
116
+ /* @__PURE__ */ i("span", { className: "line" })
117
+ ] }),
118
+ /* @__PURE__ */ s("div", { children: [
119
+ /* @__PURE__ */ s("p", { className: "show-desktop", children: [
120
+ p.city,
121
+ ", ",
122
+ I(p.country)
123
+ ] }),
124
+ /* @__PURE__ */ s("p", { className: "show-desktop", children: [
125
+ u(r.arrivalTime).format(
126
+ c(d.DATE_TIME_MEDIUM, N.FlightShortDate)
127
+ ),
128
+ " "
129
+ ] }),
130
+ /* @__PURE__ */ i("p", { className: "show-mobile", children: p.airportCode }),
131
+ /* @__PURE__ */ i("p", { className: "show-mobile", children: u(r.arrivalTime).format(
132
+ c(d.TIME_ONLY, N.FlightTime)
133
+ ) })
134
+ ] })
135
+ ] }) }),
136
+ /* @__PURE__ */ s("div", { className: "flight-footer", children: [
137
+ /* @__PURE__ */ i("div", { className: "flight-detail-container", children: /* @__PURE__ */ s(
138
+ "div",
139
+ {
140
+ className: "flight-detail",
141
+ onClick: (e) => {
142
+ e.stopPropagation(), $(!D);
143
+ },
144
+ children: [
145
+ /* @__PURE__ */ i("p", { children: "Aircraft" }),
146
+ /* @__PURE__ */ s("p", { className: "chevron-text", children: [
147
+ /* @__PURE__ */ i(V, {}),
148
+ /* @__PURE__ */ s("span", { children: [
149
+ y[0],
150
+ y.length > 1 && /* @__PURE__ */ s("sup", { children: [
151
+ "+",
152
+ y.length - 1
153
+ ] })
154
+ ] })
155
+ ] })
156
+ ]
157
+ }
158
+ ) }),
159
+ /* @__PURE__ */ s("div", { className: "booking-options ", children: [
160
+ r.cash > 0 && /* @__PURE__ */ s(
161
+ "div",
162
+ {
163
+ className: `amount-value ${h === "cash" && o ? "show-best-value-flag" : ""}`,
164
+ onClick: (e) => {
165
+ e.stopPropagation(), t(r, v.CASH);
166
+ },
167
+ children: [
168
+ /* @__PURE__ */ i("img", { src: O, alt: "marketing carrier logo" }),
169
+ /* @__PURE__ */ s("div", { children: [
170
+ /* @__PURE__ */ i("label", { children: R ? "Book For" : "From" }),
171
+ /* @__PURE__ */ i(
172
+ A,
173
+ {
174
+ amount: r.cash,
175
+ currency: r.currency,
176
+ position: C.LEFT
177
+ }
178
+ )
179
+ ] }),
180
+ h === "cash" && o && /* @__PURE__ */ s(
181
+ "div",
182
+ {
183
+ className: "best-value-flag tip",
184
+ onClick: (e) => {
185
+ e.stopPropagation(), n == null || n(r);
186
+ },
187
+ children: [
188
+ n && /* @__PURE__ */ i(S, {}),
189
+ /* @__PURE__ */ i("p", { children: "Best Value" }),
190
+ n && /* @__PURE__ */ i("span", { children: "Click to learn more" })
191
+ ]
192
+ }
193
+ )
194
+ ]
195
+ }
196
+ ),
197
+ r.points > 0 && /* @__PURE__ */ s(
198
+ "div",
199
+ {
200
+ className: `amount-value ${h === "points" && o ? "show-best-value-flag" : ""}`,
201
+ onClick: (e) => {
202
+ e.stopPropagation(), t(r, v.POINTS);
203
+ },
204
+ children: [
205
+ h === "points" && o && /* @__PURE__ */ s(
206
+ "div",
207
+ {
208
+ className: "best-value-flag tip",
209
+ onClick: (e) => {
210
+ e.stopPropagation(), n == null || n(r);
211
+ },
212
+ children: [
213
+ n && /* @__PURE__ */ i(S, {}),
214
+ /* @__PURE__ */ i("p", { children: "Best Value" }),
215
+ n && /* @__PURE__ */ i("span", { children: "Click to learn more" })
216
+ ]
217
+ }
218
+ ),
219
+ /* @__PURE__ */ i("img", { src: U.programLogo }),
220
+ /* @__PURE__ */ s("div", { children: [
221
+ /* @__PURE__ */ i("label", { children: z ? "Book For" : "From" }),
222
+ /* @__PURE__ */ s("p", { children: [
223
+ `${mr(r.points)} ${c("miles")}`,
224
+ !!P && /* @__PURE__ */ s(Y, { children: [
225
+ " + ",
226
+ /* @__PURE__ */ i(
227
+ A,
228
+ {
229
+ amount: P.amount,
230
+ currency: P.currency,
231
+ customDisplay: "No fee",
232
+ zeroDisplayOption: W.CUSTOM,
233
+ position: C.LEFT
234
+ }
235
+ )
236
+ ] })
237
+ ] })
238
+ ] })
239
+ ]
240
+ }
241
+ )
242
+ ] })
243
+ ] }),
244
+ /* @__PURE__ */ i("div", { className: `flight-details ${D ? "is-open" : ""}`, children: /* @__PURE__ */ i("div", { className: "inner", children: /* @__PURE__ */ i(
245
+ B,
246
+ {
247
+ itinerary: E.slices[0].segments,
248
+ origin: m,
249
+ destination: p,
250
+ isMultiDayFlight: q
251
+ }
252
+ ) }) })
253
+ ] })
254
+ }
255
+ );
256
+ };
257
+ export {
258
+ Er as F,
259
+ mr as c
260
+ };
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@odynn/awayz-core";
3
3
  import "@tanstack/react-query";
4
- import { F as x } from "../../FlightResult-7HBkr7Al.js";
4
+ import { F as x } from "../../FlightResult-pDdkYe7D.js";
5
5
  import "../../index-7zRjF0bU.js";
6
6
  import "../../FlightItinerary-Dy-2zMYt.js";
7
7
  import "../../enums-DxmoBOKL.js";
@@ -1,4 +1,4 @@
1
- import { F as l } from "../FlightResult-7HBkr7Al.js";
1
+ import { F as l } from "../FlightResult-pDdkYe7D.js";
2
2
  export {
3
3
  l as FlightResult
4
4
  };
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useFlightSearch as o } from "./hooks/useFlightSearch/useFlightSearch.js";
2
2
  import { useAirportSearch as g } from "./hooks/useAirportSearch/useAirportSearch.js";
3
3
  import { EBaggage as s } from "./hooks/useFlightSearch/useFlightSearch.types.js";
4
- import { F as f, c as l } from "./FlightResult-7HBkr7Al.js";
4
+ import { F as f, c as l } from "./FlightResult-pDdkYe7D.js";
5
5
  import { EPaymentType as x } from "./enums/EPaymentType.js";
6
6
  import { DEFAULT_AIRLINE_PROGRAM as C, getAirlineProgram as E, getFlightNumber as F, getLogoPath as c } from "./utils/flightUtils.js";
7
7
  import { isSameDayFlight as y } from "./utils/flightDateUtils.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-flights",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,256 +0,0 @@
1
- import { jsx as r, jsxs as s, Fragment as Y } from "react/jsx-runtime";
2
- import { RewardsService as J, CashValue as C, EToolTipPosition as I, EInvalidAmountDisplayOption as W } from "@odynn/awayz-core";
3
- import { useQuery as X } from "@tanstack/react-query";
4
- import { g as Z } from "./index-7zRjF0bU.js";
5
- import { G as w, g as M, a as d, E as N, F as V, b as B } from "./FlightItinerary-Dy-2zMYt.js";
6
- import { E as ii } from "./enums-DxmoBOKL.js";
7
- import "./arrayExtensions-DFLvtO8l.js";
8
- import ri, { useState as b, useMemo as L } from "react";
9
- import { h as u } from "./moment-BGjjqtLQ.js";
10
- import { useTranslation as ei } from "react-i18next";
11
- import { EPaymentType as v } from "./enums/EPaymentType.js";
12
- import { isSameDayFlight as si } from "./utils/flightDateUtils.js";
13
- import { DEFAULT_AIRLINE_PROGRAM as oi, getFlightNumber as ti, getFullLogoPath as ni, getLogoPath as ai, getAirlineProgram as ci } from "./utils/flightUtils.js";
14
- import './assets/FlightResult.css';const li = (i, o, a = o + "s") => i === 1 ? o : a;
15
- function mi(i) {
16
- if (!i || isNaN(i) || i < 0) return "N/A";
17
- let o = i == null ? void 0 : i.toString().split(".")[0];
18
- return o == null ? void 0 : o.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
19
- }
20
- function _(i) {
21
- return w({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z" }, child: [] }] })(i);
22
- }
23
- const Ei = ({
24
- details: i,
25
- onClick: o,
26
- showBestValue: a = !1,
27
- onShowBestValueCalculation: n,
28
- customStyling: $ = !1
29
- }) => {
30
- const { t: c } = ei(), [D, S] = b(!1), m = i.origin, p = i.destination, E = i.flightDetails, k = i.paymentOptions || [];
31
- let O = i.airlineLogo;
32
- const R = k.filter((e) => e.points === -1).length === 1, z = k.filter((e) => e.points > -1).length === 1, [U, x] = b(oi), G = async () => {
33
- const e = await ci(i.airlineProgram);
34
- x(e);
35
- }, { flightNumbers: y, airlines: K } = L(() => {
36
- const e = [], t = [];
37
- return i.flightDetails.slices.forEach((g) => {
38
- g.segments.forEach((f) => {
39
- const l = ti(f);
40
- e.includes(l) || e.push(l), O = ni(f.marketingCarrier.iataCode);
41
- const T = f.operatingCarrier;
42
- t.some((Q) => Q.airline === T.name) || t.push({
43
- logo: ai(T.iataCode),
44
- airline: T.name
45
- });
46
- });
47
- }), G(), { flightNumbers: e, airlines: t };
48
- }, [i.flightDetails.slices]), j = () => {
49
- i.cash > 0 ? o(i, v.CASH) : o(i, v.POINTS);
50
- }, q = !si(
51
- i.departureTime,
52
- i.arrivalTime
53
- ), P = i == null ? void 0 : i.airlineProgram, { data: A } = X({
54
- queryKey: [ii.VALUE_CENTS, P],
55
- queryFn: () => J.getPointsPerCent(P ?? ""),
56
- staleTime: 1 / 0,
57
- placeholderData: 0,
58
- enabled: !!P && a
59
- }), H = () => {
60
- var l;
61
- if (!i || !A || !i.points || !i.cash)
62
- return {
63
- pointsCashValue: 0,
64
- isBestValue: !1
65
- };
66
- const e = A * i.points / 100, t = ((l = i.cashFee) == null ? void 0 : l.amount) || 0;
67
- return {
68
- isPointsBestValue: e + t < i.cash
69
- };
70
- }, { isPointsBestValue: h } = H(), F = L(() => {
71
- var e, t;
72
- return (t = (e = i.paymentOptions) == null ? void 0 : e.find(
73
- (g) => g.program === i.airlineProgram
74
- )) == null ? void 0 : t.cashFee;
75
- }, [i.paymentOptions, i.airlineProgram]);
76
- return /* @__PURE__ */ r(
77
- "div",
78
- {
79
- className: `${$ ? "" : "awayz-"}flight-result`,
80
- onClick: j,
81
- children: /* @__PURE__ */ s("div", { className: "content", children: [
82
- /* @__PURE__ */ r("div", { className: "flight-info", children: /* @__PURE__ */ s("div", { className: "flight-locations", children: [
83
- /* @__PURE__ */ r("div", { className: "airlines", children: K.map((e, t) => /* @__PURE__ */ r(ri.Fragment, { children: /* @__PURE__ */ s("div", { className: "tip", children: [
84
- /* @__PURE__ */ r("img", { src: e.logo, alt: e.airline }),
85
- /* @__PURE__ */ r("span", { className: "right", children: e.airline })
86
- ] }, t) }, t)) }),
87
- /* @__PURE__ */ s("div", { className: "flight-location", children: [
88
- /* @__PURE__ */ s("p", { className: "show-desktop", children: [
89
- m.city,
90
- ",",
91
- M(m.country)
92
- ] }),
93
- /* @__PURE__ */ r("p", { className: "show-desktop", children: u(i.departureTime).format(
94
- c(d.DATE_TIME_MEDIUM, N.FlightShortDate)
95
- ) }),
96
- /* @__PURE__ */ r("p", { className: "show-mobile", children: m.airportCode }),
97
- /* @__PURE__ */ r("p", { className: "show-mobile", children: u(i.departureTime).format(
98
- c(d.TIME_ONLY, N.FlightTime)
99
- ) })
100
- ] }),
101
- /* @__PURE__ */ s("div", { className: "flight-duration", children: [
102
- /* @__PURE__ */ r("span", { className: "line" }),
103
- /* @__PURE__ */ s("p", { children: [
104
- Z(E.slices[0].duration),
105
- " ",
106
- " - ",
107
- i.numberOfStops > 0 ? `${i.numberOfStops} ${li(
108
- i.numberOfStops,
109
- "Stop"
110
- )}` : "Direct"
111
- ] }),
112
- /* @__PURE__ */ r("span", { className: "line" })
113
- ] }),
114
- /* @__PURE__ */ s("div", { children: [
115
- /* @__PURE__ */ s("p", { className: "show-desktop", children: [
116
- p.city,
117
- ", ",
118
- M(p.country)
119
- ] }),
120
- /* @__PURE__ */ s("p", { className: "show-desktop", children: [
121
- u(i.arrivalTime).format(
122
- c(d.DATE_TIME_MEDIUM, N.FlightShortDate)
123
- ),
124
- " "
125
- ] }),
126
- /* @__PURE__ */ r("p", { className: "show-mobile", children: p.airportCode }),
127
- /* @__PURE__ */ r("p", { className: "show-mobile", children: u(i.arrivalTime).format(
128
- c(d.TIME_ONLY, N.FlightTime)
129
- ) })
130
- ] })
131
- ] }) }),
132
- /* @__PURE__ */ s("div", { className: "flight-footer", children: [
133
- /* @__PURE__ */ r("div", { className: "flight-detail-container", children: /* @__PURE__ */ s(
134
- "div",
135
- {
136
- className: "flight-detail",
137
- onClick: (e) => {
138
- e.stopPropagation(), S(!D);
139
- },
140
- children: [
141
- /* @__PURE__ */ r("p", { children: "Aircraft" }),
142
- /* @__PURE__ */ s("p", { className: "chevron-text", children: [
143
- /* @__PURE__ */ r(V, {}),
144
- /* @__PURE__ */ s("span", { children: [
145
- y[0],
146
- y.length > 1 && /* @__PURE__ */ s("sup", { children: [
147
- "+",
148
- y.length - 1
149
- ] })
150
- ] })
151
- ] })
152
- ]
153
- }
154
- ) }),
155
- /* @__PURE__ */ s("div", { className: "booking-options ", children: [
156
- i.cash > 0 && /* @__PURE__ */ s(
157
- "div",
158
- {
159
- className: `amount-value ${!h && a ? "show-best-value-flag" : ""}`,
160
- onClick: (e) => {
161
- e.stopPropagation(), o(i, v.CASH);
162
- },
163
- children: [
164
- /* @__PURE__ */ r("img", { src: O, alt: "marketing carrier logo" }),
165
- /* @__PURE__ */ s("div", { children: [
166
- /* @__PURE__ */ r("label", { children: R ? "Book For" : "From" }),
167
- /* @__PURE__ */ r(
168
- C,
169
- {
170
- amount: i.cash,
171
- currency: i.currency,
172
- position: I.LEFT
173
- }
174
- )
175
- ] }),
176
- !h && a && /* @__PURE__ */ s(
177
- "div",
178
- {
179
- className: "best-value-flag tip",
180
- onClick: (e) => {
181
- e.stopPropagation(), n == null || n(i);
182
- },
183
- children: [
184
- n && /* @__PURE__ */ r(_, {}),
185
- /* @__PURE__ */ r("p", { children: "Best Value" }),
186
- n && /* @__PURE__ */ r("span", { children: "Click to learn more" })
187
- ]
188
- }
189
- )
190
- ]
191
- }
192
- ),
193
- i.points > 0 && /* @__PURE__ */ s(
194
- "div",
195
- {
196
- className: `amount-value ${h && a ? "show-best-value-flag" : ""}`,
197
- onClick: (e) => {
198
- e.stopPropagation(), o(i, v.POINTS);
199
- },
200
- children: [
201
- h && a && /* @__PURE__ */ s(
202
- "div",
203
- {
204
- className: "best-value-flag tip",
205
- onClick: (e) => {
206
- e.stopPropagation(), n == null || n(i);
207
- },
208
- children: [
209
- n && /* @__PURE__ */ r(_, {}),
210
- /* @__PURE__ */ r("p", { children: "Best Value" }),
211
- n && /* @__PURE__ */ r("span", { children: "Click to learn more" })
212
- ]
213
- }
214
- ),
215
- /* @__PURE__ */ r("img", { src: U.programLogo }),
216
- /* @__PURE__ */ s("div", { children: [
217
- /* @__PURE__ */ r("label", { children: z ? "Book For" : "From" }),
218
- /* @__PURE__ */ s("p", { children: [
219
- `${mi(i.points)} ${c("miles")}`,
220
- !!F && /* @__PURE__ */ s(Y, { children: [
221
- " + ",
222
- /* @__PURE__ */ r(
223
- C,
224
- {
225
- amount: F.amount,
226
- currency: F.currency,
227
- customDisplay: "No fee",
228
- zeroDisplayOption: W.CUSTOM,
229
- position: I.LEFT
230
- }
231
- )
232
- ] })
233
- ] })
234
- ] })
235
- ]
236
- }
237
- )
238
- ] })
239
- ] }),
240
- /* @__PURE__ */ r("div", { className: `flight-details ${D ? "is-open" : ""}`, children: /* @__PURE__ */ r("div", { className: "inner", children: /* @__PURE__ */ r(
241
- B,
242
- {
243
- itinerary: E.slices[0].segments,
244
- origin: m,
245
- destination: p,
246
- isMultiDayFlight: q
247
- }
248
- ) }) })
249
- ] })
250
- }
251
- );
252
- };
253
- export {
254
- Ei as F,
255
- mi as c
256
- };