@odynn/awayz-flights 0.4.8 → 0.4.10

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,244 @@
1
+ import { jsx as r, jsxs as n, Fragment as H } from "react/jsx-runtime";
2
+ import { RewardsService as K, CashValue as b, EInvalidAmountDisplayOption as Q } from "@odynn/awayz-core";
3
+ import { useQuery as J } from "@tanstack/react-query";
4
+ import { g as W } from "./index-7zRjF0bU.js";
5
+ import { G as X, g as A, E as N, F as Y, a as Z } from "./FlightItinerary-DWOexFxM.js";
6
+ import { E as w } from "./enums-B584l_96.js";
7
+ import "./arrayExtensions-DFLvtO8l.js";
8
+ import V, { useState as E, useMemo as I } from "react";
9
+ import { h as u } from "./moment-BGjjqtLQ.js";
10
+ import { EPaymentType as v } from "./enums/EPaymentType.js";
11
+ import { isSameDayFlight as B } from "./utils/flightDateUtils.js";
12
+ import { DEFAULT_AIRLINE_PROGRAM as ii, getFlightNumber as ri, getLogoPath as S, getAirlineProgram as ei } from "./utils/flightUtils.js";
13
+ import './assets/FlightResult.css';function ni(i) {
14
+ if (!i || isNaN(i) || i < 0) return "N/A";
15
+ let t = i == null ? void 0 : i.toString().split(".")[0];
16
+ return t == null ? void 0 : t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
17
+ }
18
+ function L(i) {
19
+ return X({ 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);
20
+ }
21
+ const Ni = ({
22
+ details: i,
23
+ onClick: t,
24
+ showBestValue: o = !1,
25
+ onShowBestValueCalculation: a
26
+ }) => {
27
+ const [C, M] = E(!1), m = i.origin, h = i.destination, k = i.flightDetails, O = i.paymentOptions || [], R = O.filter((e) => e.points === -1).length === 1, $ = O.filter((e) => e.points > -1).length === 1, [x, z] = E(ii), G = async () => {
28
+ const e = await ei(i.airlineProgram);
29
+ z(e);
30
+ }, { flightNumbers: y, airlines: U } = I(() => {
31
+ const e = [], s = [];
32
+ return i.flightDetails.slices.forEach((g) => {
33
+ g.segments.forEach((f) => {
34
+ const c = ri(f);
35
+ e.includes(c) || e.push(c);
36
+ const l = f.marketingCarrier, d = f.operatingCarrier;
37
+ s.some((D) => D.airline === d.name) || s.push({
38
+ logo: S(d.iataCode),
39
+ airline: d.name
40
+ }), l && d.name !== l.name && !s.some((D) => D.airline === l.name) && s.push({
41
+ logo: S(l.iataCode),
42
+ airline: l.name
43
+ });
44
+ });
45
+ }), G(), { flightNumbers: e, airlines: s };
46
+ }, [i.flightDetails.slices]), _ = () => {
47
+ i.cash > 0 ? t(i, v.CASH) : t(i, v.POINTS);
48
+ }, j = !B(
49
+ i.departureTime,
50
+ i.arrivalTime
51
+ ), P = i == null ? void 0 : i.airlineProgram, { data: T } = J({
52
+ queryKey: [w.VALUE_CENTS, P],
53
+ queryFn: () => K.getPointsPerCent(P ?? ""),
54
+ staleTime: 1 / 0,
55
+ placeholderData: 0,
56
+ enabled: !!P && o
57
+ }), q = () => {
58
+ var c;
59
+ if (!i || !T || !i.points || !i.cash)
60
+ return {
61
+ pointsCashValue: 0,
62
+ isBestValue: !1
63
+ };
64
+ const e = T * i.points / 100, s = ((c = i.cashFee) == null ? void 0 : c.amount) || 0;
65
+ return {
66
+ isPointsBestValue: e + s < i.cash
67
+ };
68
+ }, { isPointsBestValue: p } = q(), F = I(() => {
69
+ var e, s;
70
+ return (s = (e = i.paymentOptions) == null ? void 0 : e.find(
71
+ (g) => g.program === i.airlineProgram
72
+ )) == null ? void 0 : s.cashFee;
73
+ }, [i.paymentOptions, i.airlineProgram]);
74
+ return /* @__PURE__ */ r("div", { className: "flight-result", onClick: _, children: /* @__PURE__ */ n("div", { className: "content", children: [
75
+ /* @__PURE__ */ r("div", { className: "flight-info", children: /* @__PURE__ */ n("div", { className: "flight-locations", children: [
76
+ /* @__PURE__ */ r("div", { className: "airlines", children: U.map((e, s) => /* @__PURE__ */ r(V.Fragment, { children: /* @__PURE__ */ n("div", { className: "tip", children: [
77
+ /* @__PURE__ */ r("img", { src: e.logo, alt: e.airline }),
78
+ /* @__PURE__ */ r("span", { className: "right", children: e.airline })
79
+ ] }, s) }, s)) }),
80
+ /* @__PURE__ */ n("div", { className: "flight-location", children: [
81
+ /* @__PURE__ */ n("p", { className: "show-desktop", children: [
82
+ m.city,
83
+ ",",
84
+ A(m.country)
85
+ ] }),
86
+ /* @__PURE__ */ r("p", { className: "show-desktop", children: u(i.departureTime).format(
87
+ N.FlightShortDate
88
+ ) }),
89
+ /* @__PURE__ */ r("p", { className: "show-mobile", children: m.airportCode }),
90
+ /* @__PURE__ */ r("p", { className: "show-mobile", children: u(i.departureTime).format(N.FlightTime) })
91
+ ] }),
92
+ /* @__PURE__ */ n("div", { className: "flight-duration", children: [
93
+ /* @__PURE__ */ r("span", { className: "line" }),
94
+ /* @__PURE__ */ n("p", { children: [
95
+ W(k.slices[0].duration),
96
+ " ",
97
+ " - ",
98
+ i.numberOfStops > 0 ? `${i.numberOfStops} Stop${i.numberOfStops > 1 ? "s" : ""}` : "Direct"
99
+ ] }),
100
+ /* @__PURE__ */ r("span", { className: "line" })
101
+ ] }),
102
+ /* @__PURE__ */ n("div", { children: [
103
+ /* @__PURE__ */ n("p", { className: "show-desktop", children: [
104
+ h.city,
105
+ ", ",
106
+ A(h.country)
107
+ ] }),
108
+ /* @__PURE__ */ n("p", { className: "show-desktop", children: [
109
+ u(i.arrivalTime).format(
110
+ N.FlightShortDate
111
+ ),
112
+ " "
113
+ ] }),
114
+ /* @__PURE__ */ r("p", { className: "show-mobile", children: h.airportCode }),
115
+ /* @__PURE__ */ r("p", { className: "show-mobile", children: u(i.arrivalTime).format(N.FlightTime) })
116
+ ] })
117
+ ] }) }),
118
+ /* @__PURE__ */ n("div", { className: "flight-footer", children: [
119
+ /* @__PURE__ */ n("div", { className: "flight-detail-container", children: [
120
+ /* @__PURE__ */ n(
121
+ "div",
122
+ {
123
+ className: "flight-detail",
124
+ onClick: (e) => {
125
+ e.stopPropagation(), M(!C);
126
+ },
127
+ children: [
128
+ /* @__PURE__ */ r("p", { children: "Aircraft" }),
129
+ /* @__PURE__ */ n("p", { className: "chevron-text", children: [
130
+ /* @__PURE__ */ r(Y, {}),
131
+ /* @__PURE__ */ n("span", { children: [
132
+ y[0],
133
+ y.length > 1 && /* @__PURE__ */ n("sup", { children: [
134
+ "+",
135
+ y.length - 1
136
+ ] })
137
+ ] })
138
+ ] })
139
+ ]
140
+ }
141
+ ),
142
+ i.cabinClass && /* @__PURE__ */ n("div", { className: "flight-detail", children: [
143
+ /* @__PURE__ */ r("p", { children: "Class" }),
144
+ /* @__PURE__ */ r("p", { children: i.cabinClass })
145
+ ] })
146
+ ] }),
147
+ /* @__PURE__ */ n("div", { className: "booking-options ", children: [
148
+ i.cash > 0 && /* @__PURE__ */ n(
149
+ "div",
150
+ {
151
+ className: `amount-value ${!p && o ? "show-best-value-flag" : ""}`,
152
+ onClick: (e) => {
153
+ e.stopPropagation(), t(i, v.CASH);
154
+ },
155
+ children: [
156
+ /* @__PURE__ */ r("img", { src: i.airlineLogo }),
157
+ /* @__PURE__ */ n("div", { children: [
158
+ /* @__PURE__ */ r("label", { children: R ? "Book For" : "From" }),
159
+ /* @__PURE__ */ r(
160
+ b,
161
+ {
162
+ amount: i.cash,
163
+ currency: i.currency
164
+ }
165
+ )
166
+ ] }),
167
+ !p && o && /* @__PURE__ */ n(
168
+ "div",
169
+ {
170
+ className: "best-value-flag tip",
171
+ onClick: (e) => {
172
+ e.stopPropagation(), a == null || a(i);
173
+ },
174
+ children: [
175
+ a && /* @__PURE__ */ r(L, {}),
176
+ /* @__PURE__ */ r("p", { children: "Best Value" }),
177
+ a && /* @__PURE__ */ r("span", { children: "Click to learn more" })
178
+ ]
179
+ }
180
+ )
181
+ ]
182
+ }
183
+ ),
184
+ i.points > 0 && /* @__PURE__ */ n(
185
+ "div",
186
+ {
187
+ className: `amount-value ${p && o ? "show-best-value-flag" : ""}`,
188
+ onClick: (e) => {
189
+ e.stopPropagation(), t(i, v.POINTS);
190
+ },
191
+ children: [
192
+ p && o && /* @__PURE__ */ n(
193
+ "div",
194
+ {
195
+ className: "best-value-flag tip",
196
+ onClick: (e) => {
197
+ e.stopPropagation(), a == null || a(i);
198
+ },
199
+ children: [
200
+ a && /* @__PURE__ */ r(L, {}),
201
+ /* @__PURE__ */ r("p", { children: "Best Value" }),
202
+ a && /* @__PURE__ */ r("span", { children: "Click to learn more" })
203
+ ]
204
+ }
205
+ ),
206
+ /* @__PURE__ */ r("img", { src: x.programLogo }),
207
+ /* @__PURE__ */ n("div", { children: [
208
+ /* @__PURE__ */ r("label", { children: $ ? "Book For" : "From" }),
209
+ /* @__PURE__ */ n("p", { children: [
210
+ `${ni(i.points)} miles`,
211
+ !!F && /* @__PURE__ */ n(H, { children: [
212
+ " + ",
213
+ /* @__PURE__ */ r(
214
+ b,
215
+ {
216
+ amount: F.amount,
217
+ currency: F.currency,
218
+ customDisplay: "No fee",
219
+ zeroDisplayOption: Q.CUSTOM
220
+ }
221
+ )
222
+ ] })
223
+ ] })
224
+ ] })
225
+ ]
226
+ }
227
+ )
228
+ ] })
229
+ ] }),
230
+ /* @__PURE__ */ r("div", { className: `flight-details ${C ? "is-open" : ""}`, children: /* @__PURE__ */ r("div", { className: "inner", children: /* @__PURE__ */ r(
231
+ Z,
232
+ {
233
+ itinerary: k.slices[0].segments,
234
+ origin: m,
235
+ destination: h,
236
+ isMultiDayFlight: j
237
+ }
238
+ ) }) })
239
+ ] }) });
240
+ };
241
+ export {
242
+ Ni as F,
243
+ ni as c
244
+ };
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tip{position:relative}.tip>span{background-color:#14181f;color:#fff;padding:.5rem;border-radius:.25rem;position:absolute;bottom:110%;left:50%;transform:translate(-50%);display:none;transition:all .2s ease-in-out;z-index:100;width:max-content;font-size:.6rem;font-weight:600;text-transform:uppercase;line-height:.8rem;text-align:center;box-sizing:border-box;pointer-events:none}@media screen and (max-width: 480px){.tip>span{width:fit-content}}.tip>span.left{right:100%;top:50%;bottom:auto;left:auto;transform:translateY(-50%)}.tip>span.left:before{left:auto;right:-7.5px;top:50%;transform:translateY(-50%) rotate(-90deg)}.tip>span.right{left:100%;top:50%;bottom:auto;right:auto;transform:translateY(-50%)}.tip>span.right:before{left:-7.5px;right:auto;top:50%;transform:translateY(-50%) rotate(90deg)}.tip>span.bottom{top:100%;left:50%;right:auto;bottom:auto;transform:translate(-50%)}.tip>span.bottom:before{left:50%;right:auto;top:-5px;transform:translate(-50%) rotate(180deg)}.tip>span:before{content:"";position:absolute;bottom:-5px;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #14181f}.tip:hover>span,.tip:focus>span{display:flex;animation:tip-fade-up .2s ease-in-out}.tip:hover>span.right,.tip:focus>span.right{animation:tip-fade-right .2s ease-in-out}.tip:hover>span.left,.tip:focus>span.left{animation:tip-fade-left .2s ease-in-out}.tip:hover>span.bottom,.tip:focus>span.bottom{animation:tip-fade-down .2s ease-in-out}@keyframes slide-in-right{0%{opacity:0;transform:translate(0)}50%{transform:translate(-100vw);opacity:0}50.001%{opacity:0;transform:translate(105vw)}50.002%{opacity:1;transform:translate(100vw)}to{transform:translate(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(0)}50%{transform:translate(100vw);opacity:0}50.001%{opacity:0;transform:translate(-100vw)}50.002%{opacity:1;transform:translate(-100vw)}to{transform:translate(0)}}@keyframes slide-out-right{0%{transform:translate(0)}to{transform:translate(100vw);opacity:1}}@keyframes slide-out-left{0%{transform:translate(0)}to{transform:translate(-100vw);opacity:1}}@keyframes slide-up{0%{transform:translateY(100%)}to{transform:translate(0);opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes fade-in{0%{opacity:0;scale:.9}to{opacity:1;scale:1}}@keyframes scale-out{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes scale-in{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes no-no{0%{transform:translate(0)}20%{transform:translate(-20px)}40%{transform:translate(15px)}60%{transform:translate(-10px)}80%{transform:translate(5px)}to{transform:translate(0)}}@keyframes loading-track{0%{transform:translate(-100%);opacity:0}25%{opacity:1}75%{opacity:1}to{opacity:0;transform:translate(100%)}}@keyframes loading-in{0%{height:0}to{height:5px}}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes shine{0%{background-position:right}}@keyframes text-pulse{0%{opacity:.75}35%{opacity:1}65%{opacity:1}to{opacity:.75}}@keyframes pulse{0%{opacity:.85}35%{opacity:1}65%{opacity:1}to{opacity:.85}}@keyframes shimmer{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes fade-up{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-down{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-right{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes spring-in{0%{opacity:0;transform:scale(.8)}70%{opacity:1;transform:scale(1.05)}to{opacity:1;transform:scale(1)}}@keyframes ripple{0%{transform:scale(1)}to{transform:scale(1.1,1.4)}}@keyframes tip-fade-right{0%{opacity:0;transform:translate(-20px,-50%)}to{opacity:1;transform:translateY(-50%)}}@keyframes tip-fade-left{0%{opacity:0;transform:translate(20px,-50%)}to{opacity:1;transform:translateY(-50%)}}@keyframes tip-fade-down{0%{opacity:0;transform:translate(-50%,-20px)}to{opacity:1;transform:translate(-50%)}}@keyframes tip-fade-up{0%{opacity:0;transform:translate(-50%,5px)}to{opacity:1;transform:translate(-50%)}}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slide-out{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}@keyframes scale-fade-in{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}@keyframes scroll-horizontally{0%{transform:translate(0)}to{transform:translate(-50%)}}.flight-result{background-color:var(--foreground, #fff);border-radius:.5rem;border:1px solid var(--border, #e7eef3);overflow:hidden;width:100%;margin:0 auto;position:relative;height:fit-content;padding:1px;transition:all .2s ease-in-out;z-index:10;animation:fade-up .2s ease-in-out both;backface-visibility:hidden}.flight-result .content{overflow:hidden;border-radius:.4rem;width:100%;margin:0 auto;position:relative;height:fit-content;z-index:1;display:flex;flex-direction:column}.flight-result .content>div{z-index:2}.flight-result .content>div.flight-info{flex:4;display:flex;flex-direction:column;min-height:60%;gap:.5rem;padding:1rem}.flight-result .content>div.flight-info .airlines{position:relative;width:50px;max-width:50px;height:30px}.flight-result .content>div.flight-info .airlines>div{position:absolute;display:flex;align-items:center;gap:.5rem;border:1px solid var(--border, #e7eef3);border-radius:50%;height:30px;width:30px;justify-content:center;background-color:var(--foreground, #fff)}.flight-result .content>div.flight-info .airlines>div img{width:70%}.flight-result .content>div.flight-info .airlines>div:nth-child(2){top:10px;left:15px}.flight-result .content>div.flight-info .airlines>div:nth-child(3){top:-10px;left:20px}.flight-result .content>div.flight-info .airlines>div span{font-size:.7rem}.flight-result .content>div.flight-info .airlines p{font-weight:600}.flight-result .content>div.flight-info .flight-locations{align-items:center;gap:1rem;display:flex}.flight-result .content>div.flight-info .flight-locations .show-desktop{display:none}@media screen and (min-width: 768px){.flight-result .content>div.flight-info .flight-locations .show-desktop{display:flex}}.flight-result .content>div.flight-info .flight-locations .show-mobile{display:none}@media screen and (max-width: 768px){.flight-result .content>div.flight-info .flight-locations .show-mobile{display:flex}}.flight-result .content>div.flight-info .flight-locations:last-child div p:first-child{font-weight:600}.flight-result .content>div.flight-info .flight-locations>div{flex:1;font-size:.8rem}.flight-result .content>div.flight-info .flight-locations>div:first-child{text-align:left}.flight-result .content>div.flight-info .flight-locations>div:last-child{text-align:right}.flight-result .content>div.flight-info .flight-locations .flight-duration{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:1rem;font-weight:600;font-size:.7rem}.flight-result .content>div.flight-info .flight-locations .line{height:2px;flex:1;background:repeating-linear-gradient(90deg,var(--border, #e7eef3) 0 20px,rgba(0,0,0,0) 0 30px);z-index:1}.flight-result .content>div.flight-info .flight-locations>div{display:flex;flex-direction:column;text-align:center;flex:1;width:100%}.flight-result .content>div.flight-info .flight-locations>div.duration{flex-direction:row;align-items:center;justify-content:center;gap:.5rem}.flight-result .content>div.flight-info .flight-locations>div.duration p{opacity:.4}.flight-result .content>div.flight-info .flight-locations>div.flight-location{text-align:left;align-items:flex-start;max-width:fit-content}.flight-result .content>div.flight-info .flight-locations>div:last-child{text-align:right;align-items:flex-end;max-width:fit-content}.flight-result .content>div.flight-footer{flex:2;display:flex;justify-content:space-between;align-items:center;padding:1rem;gap:1rem;background-color:var(--background, #f9fdff);border-top:1px solid var(--border, #e7eef3)}@media screen and (max-width: 1024px){.flight-result .content>div.flight-footer{flex-direction:column}}.flight-result .content>div.flight-footer .view-details{display:flex;align-items:center;gap:1rem;cursor:pointer;-webkit-user-select:none;user-select:none}.flight-result .content>div.flight-footer .booking-options{display:flex;justify-content:flex-end;gap:1rem;font-size:.8rem;flex:3}@media screen and (max-width: 1024px){.flight-result .content>div.flight-footer .booking-options{width:100%;flex-direction:column}}.flight-result .content>div.flight-footer .booking-options>div{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--border, #e7eef3);border-radius:50rem;padding:.5rem 1rem;gap:2rem;cursor:pointer;transition:all .2s ease-in-out;background-color:var(--foreground, #fff)}.flight-result .content>div.flight-footer .booking-options>div img{height:30px;max-width:100px}.flight-result .content>div.flight-footer .booking-options>div>div{display:flex;flex-direction:column}.flight-result .content>div.flight-footer .booking-options>div label{font-size:.7rem;font-weight:600}.flight-result .content>div.flight-footer .booking-options>div.amount-value{position:relative}.flight-result .content>div.flight-footer .booking-options>div.amount-value .currency-conversion{display:flex}.flight-result .content>div.flight-footer .booking-options>div.amount-value .best-value-flag{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:.25rem;position:absolute;right:-1px;padding:.25rem .5rem;top:-1rem;color:var(--foreground, #fff);border-radius:50rem;font-weight:600;background-color:#1495f2;border-bottom-right-radius:0;font-size:.7rem}.flight-result .content>div.flight-footer .booking-options>div.amount-value .best-value-flag p{color:var(--foreground, #fff)}.flight-result .content>div.flight-footer .booking-options>div.amount-value.show-best-value-flag{border-color:#1495f2;border-top-right-radius:0}.flight-result .content>div.flight-footer .booking-options>div:first-of-type{grid-area:price}.flight-result .content>div.flight-footer .booking-options>div:last-of-type{grid-area:points}.flight-result .content>div.flight-footer .booking-options>div:hover{background-color:var(--background, #f9fdff)}@media screen and (max-width: 1024px){.flight-result .content>div.flight-footer .booking-options>div{flex-direction:row;justify-content:space-between;align-items:center}.flight-result .content>div.flight-footer .booking-options>div.amount-value{text-align:center}.flight-result .content>div.flight-footer .booking-options>div.amount-value img{height:30px;max-width:80px}.flight-result .content>div.flight-footer .booking-options>div p:last-child{font-weight:600;font-size:1rem}}.flight-result .content .flight-detail-container{display:flex;gap:1rem;justify-content:space-between}@media screen and (max-width: 1024px){.flight-result .content .flight-detail-container{width:100%}}.flight-result .content .flight-detail:not(:first-of-type){border-left:1px solid var(--border, #e7eef3);padding:0 2rem}@media screen and (max-width: 1024px){.flight-result .content .flight-detail:not(:first-of-type){padding:0 .5rem}}.flight-result .content .flight-detail p{font-size:.8rem}.flight-result .content .flight-detail p:first-of-type{font-size:.7rem;color:var(--text-light, rgba(37, 46, 52, .2509803922))}.flight-result .content .flight-detail p:last-of-type{font-weight:600}.flight-result .content .flight-detail p.chevron-text{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.flight-result .flight-details{display:grid;grid-template-rows:0fr;transition:all .2s ease-in-out;background-color:var(--foreground, #fff);border-top:1px solid var(--border, #e7eef3);border-width:0}.flight-result .flight-details.is-open{grid-template-rows:1fr;padding:1rem;border-top:1px solid var(--border, #e7eef3)}.flight-result .flight-details.is-open .inner{padding:1rem 0;scale:1;opacity:1}.flight-result .flight-details .inner{overflow:hidden;transition:all .2s ease-in-out;scale:.9;opacity:0;transform-origin:top center}.flight-result .skeleton{margin-bottom:2px}.flight-result:hover{cursor:pointer}.flight-result.skeleton-loader .content>div.flight-info .flight-locations>div.flight-location{max-width:unset}.flight-result.skeleton-loader .content>div.flight-info .flight-locations>div:last-child{max-width:unset}
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@media (prefers-color-scheme: dark){body[data-theme=auto]{--background: #14181f;--opaque-background: #20242880;--foreground: #22272d;--text: #c3c9d2;--text-light: #c3c9d260;--border: #3b4048}}@media (prefers-color-scheme: light){body[data-theme=auto]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}}body[data-theme=light]{--background: #f9fdff;--opaque-background: #f9fdff95;--foreground: #fff;--text: #252e34;--text-light: #252e3460;--border: #e7eef3}*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tip{position:relative}.tip>span{background-color:#14181f;color:#fff;padding:.5rem;border-radius:.25rem;position:absolute;bottom:110%;left:50%;transform:translate(-50%);display:none;transition:all .2s ease-in-out;z-index:100;width:max-content;font-size:.6rem;font-weight:600;text-transform:uppercase;line-height:.8rem;text-align:center;box-sizing:border-box;pointer-events:none}@media screen and (max-width: 480px){.tip>span{width:fit-content}}.tip>span.left{right:100%;top:50%;bottom:auto;left:auto;transform:translateY(-50%)}.tip>span.left:before{left:auto;right:-7.5px;top:50%;transform:translateY(-50%) rotate(-90deg)}.tip>span.right{left:100%;top:50%;bottom:auto;right:auto;transform:translateY(-50%)}.tip>span.right:before{left:-7.5px;right:auto;top:50%;transform:translateY(-50%) rotate(90deg)}.tip>span.bottom{top:100%;left:50%;right:auto;bottom:auto;transform:translate(-50%)}.tip>span.bottom:before{left:50%;right:auto;top:-5px;transform:translate(-50%) rotate(180deg)}.tip>span:before{content:"";position:absolute;bottom:-5px;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #14181f}.tip:hover>span,.tip:focus>span{display:flex;animation:tip-fade-up .2s ease-in-out}.tip:hover>span.right,.tip:focus>span.right{animation:tip-fade-right .2s ease-in-out}.tip:hover>span.left,.tip:focus>span.left{animation:tip-fade-left .2s ease-in-out}.tip:hover>span.bottom,.tip:focus>span.bottom{animation:tip-fade-down .2s ease-in-out}@keyframes slide-in-right{0%{opacity:0;transform:translate(0)}50%{transform:translate(-100vw);opacity:0}50.001%{opacity:0;transform:translate(105vw)}50.002%{opacity:1;transform:translate(100vw)}to{transform:translate(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(0)}50%{transform:translate(100vw);opacity:0}50.001%{opacity:0;transform:translate(-100vw)}50.002%{opacity:1;transform:translate(-100vw)}to{transform:translate(0)}}@keyframes slide-out-right{0%{transform:translate(0)}to{transform:translate(100vw);opacity:1}}@keyframes slide-out-left{0%{transform:translate(0)}to{transform:translate(-100vw);opacity:1}}@keyframes slide-up{0%{transform:translateY(100%)}to{transform:translate(0);opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes fade-in{0%{opacity:0;scale:.9}to{opacity:1;scale:1}}@keyframes scale-out{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes scale-in{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes no-no{0%{transform:translate(0)}20%{transform:translate(-20px)}40%{transform:translate(15px)}60%{transform:translate(-10px)}80%{transform:translate(5px)}to{transform:translate(0)}}@keyframes loading-track{0%{transform:translate(-100%);opacity:0}25%{opacity:1}75%{opacity:1}to{opacity:0;transform:translate(100%)}}@keyframes loading-in{0%{height:0}to{height:5px}}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes shine{0%{background-position:right}}@keyframes text-pulse{0%{opacity:.75}35%{opacity:1}65%{opacity:1}to{opacity:.75}}@keyframes pulse{0%{opacity:.85}35%{opacity:1}65%{opacity:1}to{opacity:.85}}@keyframes shimmer{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes fade-up{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-down{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-right{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes spring-in{0%{opacity:0;transform:scale(.8)}70%{opacity:1;transform:scale(1.05)}to{opacity:1;transform:scale(1)}}@keyframes ripple{0%{transform:scale(1)}to{transform:scale(1.1,1.4)}}@keyframes tip-fade-right{0%{opacity:0;transform:translate(-20px,-50%)}to{opacity:1;transform:translateY(-50%)}}@keyframes tip-fade-left{0%{opacity:0;transform:translate(20px,-50%)}to{opacity:1;transform:translateY(-50%)}}@keyframes tip-fade-down{0%{opacity:0;transform:translate(-50%,-20px)}to{opacity:1;transform:translate(-50%)}}@keyframes tip-fade-up{0%{opacity:0;transform:translate(-50%,5px)}to{opacity:1;transform:translate(-50%)}}@keyframes slide-in{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slide-out{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}@keyframes scale-fade-in{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}@keyframes scroll-horizontally{0%{transform:translate(0)}to{transform:translate(-50%)}}.flight-result{background-color:var(--foreground, #fff);border-radius:.5rem;border:1px solid var(--border, #e7eef3);overflow:hidden;width:100%;margin:0 auto;position:relative;height:fit-content;padding:1px;transition:all .2s ease-in-out;z-index:10;animation:fade-up .2s ease-in-out both;backface-visibility:hidden}.flight-result .content{overflow:hidden;border-radius:.4rem;width:100%;margin:0 auto;position:relative;height:fit-content;z-index:1;display:flex;flex-direction:column}.flight-result .content>div{z-index:2}.flight-result .content>div.flight-info{flex:4;display:flex;flex-direction:column;min-height:60%;gap:.5rem;padding:1rem}.flight-result .content>div.flight-info .airlines{position:relative;width:50px;max-width:50px;height:30px}.flight-result .content>div.flight-info .airlines>div{position:absolute;display:flex;align-items:center;gap:.5rem;border:1px solid var(--border, #e7eef3);border-radius:50%;height:30px;width:30px;justify-content:center;background-color:var(--foreground, #fff)}.flight-result .content>div.flight-info .airlines>div img{width:70%}.flight-result .content>div.flight-info .airlines>div:nth-child(2){top:10px;left:15px}.flight-result .content>div.flight-info .airlines>div:nth-child(3){top:-10px;left:20px}.flight-result .content>div.flight-info .airlines>div span{font-size:.7rem}.flight-result .content>div.flight-info .airlines p{font-weight:600}.flight-result .content>div.flight-info .flight-locations{align-items:center;gap:1rem;display:flex}.flight-result .content>div.flight-info .flight-locations .show-desktop{display:none}@media screen and (min-width: 768px){.flight-result .content>div.flight-info .flight-locations .show-desktop{display:flex}}.flight-result .content>div.flight-info .flight-locations .show-mobile{display:none}@media screen and (max-width: 768px){.flight-result .content>div.flight-info .flight-locations .show-mobile{display:flex}}.flight-result .content>div.flight-info .flight-locations:last-child div p:first-child{font-weight:600}.flight-result .content>div.flight-info .flight-locations>div{flex:1;font-size:.8rem}.flight-result .content>div.flight-info .flight-locations>div:first-child{text-align:left}.flight-result .content>div.flight-info .flight-locations>div:last-child{text-align:right}.flight-result .content>div.flight-info .flight-locations .flight-duration{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:1rem;font-weight:600;font-size:.7rem}.flight-result .content>div.flight-info .flight-locations .line{height:2px;flex:1;background:repeating-linear-gradient(90deg,var(--border, #e7eef3) 0 20px,rgba(0,0,0,0) 0 30px);z-index:1}.flight-result .content>div.flight-info .flight-locations>div{display:flex;flex-direction:column;text-align:center;flex:1;width:100%}.flight-result .content>div.flight-info .flight-locations>div.duration{flex-direction:row;align-items:center;justify-content:center;gap:.5rem}.flight-result .content>div.flight-info .flight-locations>div.duration p{opacity:.4}.flight-result .content>div.flight-info .flight-locations>div.flight-location{text-align:left;align-items:flex-start;max-width:fit-content}.flight-result .content>div.flight-info .flight-locations>div:last-child{text-align:right;align-items:flex-end;max-width:fit-content}.flight-result .content>div.flight-footer{flex:2;display:flex;justify-content:space-between;align-items:center;padding:1rem;gap:1rem;background-color:var(--background, #f9fdff);border-top:1px solid var(--border, #e7eef3)}@media screen and (max-width: 1024px){.flight-result .content>div.flight-footer{flex-direction:column}}.flight-result .content>div.flight-footer .view-details{display:flex;align-items:center;gap:1rem;cursor:pointer;-webkit-user-select:none;user-select:none}.flight-result .content>div.flight-footer .booking-options{display:flex;justify-content:flex-end;gap:1rem;font-size:.8rem;flex:3}@media screen and (max-width: 1024px){.flight-result .content>div.flight-footer .booking-options{width:100%;flex-direction:column}}.flight-result .content>div.flight-footer .booking-options>div{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--border, #e7eef3);border-radius:50rem;padding:.5rem 1rem;gap:2rem;cursor:pointer;transition:all .2s ease-in-out;background-color:var(--foreground, #fff)}.flight-result .content>div.flight-footer .booking-options>div img{height:30px;max-width:100px}.flight-result .content>div.flight-footer .booking-options>div>div{display:flex;flex-direction:column}.flight-result .content>div.flight-footer .booking-options>div label{font-size:.7rem;font-weight:600}.flight-result .content>div.flight-footer .booking-options>div.amount-value{position:relative}.flight-result .content>div.flight-footer .booking-options>div.amount-value .currency-conversion{display:flex}.flight-result .content>div.flight-footer .booking-options>div.amount-value .best-value-flag{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:.25rem;position:absolute;right:-1px;padding:.25rem .5rem;top:-1rem;color:var(--foreground, #fff);border-radius:50rem;font-weight:600;background-color:#1495f2;border-bottom-right-radius:0;font-size:.7rem}.flight-result .content>div.flight-footer .booking-options>div.amount-value .best-value-flag p{color:var(--foreground, #fff)}.flight-result .content>div.flight-footer .booking-options>div.amount-value.show-best-value-flag{border-color:#1495f2;border-top-right-radius:0}.flight-result .content>div.flight-footer .booking-options>div.amount-value p{display:flex;gap:.25rem}.flight-result .content>div.flight-footer .booking-options>div:first-of-type{grid-area:price}.flight-result .content>div.flight-footer .booking-options>div:last-of-type{grid-area:points}.flight-result .content>div.flight-footer .booking-options>div:hover{background-color:var(--background, #f9fdff)}@media screen and (max-width: 1024px){.flight-result .content>div.flight-footer .booking-options>div{flex-direction:row;justify-content:space-between;align-items:center}.flight-result .content>div.flight-footer .booking-options>div.amount-value{text-align:center}.flight-result .content>div.flight-footer .booking-options>div.amount-value img{height:30px;max-width:80px}.flight-result .content>div.flight-footer .booking-options>div p:last-child{font-weight:600;font-size:1rem}}.flight-result .content .flight-detail-container{display:flex;gap:1rem;justify-content:space-between}@media screen and (max-width: 1024px){.flight-result .content .flight-detail-container{width:100%}}.flight-result .content .flight-detail:not(:first-of-type){border-left:1px solid var(--border, #e7eef3);padding:0 2rem}@media screen and (max-width: 1024px){.flight-result .content .flight-detail:not(:first-of-type){padding:0 .5rem}}.flight-result .content .flight-detail p{font-size:.8rem}.flight-result .content .flight-detail p:first-of-type{font-size:.7rem;color:var(--text-light, rgba(37, 46, 52, .2509803922))}.flight-result .content .flight-detail p:last-of-type{font-weight:600}.flight-result .content .flight-detail p.chevron-text{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.flight-result .flight-details{display:grid;grid-template-rows:0fr;transition:all .2s ease-in-out;background-color:var(--foreground, #fff);border-top:1px solid var(--border, #e7eef3);border-width:0}.flight-result .flight-details.is-open{grid-template-rows:1fr;padding:1rem;border-top:1px solid var(--border, #e7eef3)}.flight-result .flight-details.is-open .inner{padding:1rem 0;scale:1;opacity:1}.flight-result .flight-details .inner{overflow:hidden;transition:all .2s ease-in-out;scale:.9;opacity:0;transform-origin:top center}.flight-result .skeleton{margin-bottom:2px}.flight-result:hover{cursor:pointer}.flight-result.skeleton-loader .content>div.flight-info .flight-locations>div.flight-location{max-width:unset}.flight-result.skeleton-loader .content>div.flight-info .flight-locations>div:last-child{max-width:unset}
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "@odynn/awayz-core";
3
3
  import "@tanstack/react-query";
4
4
  import "../../index-7zRjF0bU.js";
5
- import { F as u } from "../../FlightResult-tMtn9zsZ.js";
5
+ import { F as u } from "../../FlightResult-CO2dUnkp.js";
6
6
  import "../../FlightItinerary-DWOexFxM.js";
7
7
  import "../../enums-B584l_96.js";
8
8
  import "../../arrayExtensions-DFLvtO8l.js";
@@ -1,4 +1,4 @@
1
- import { F as l } from "../FlightResult-tMtn9zsZ.js";
1
+ import { F as l } from "../FlightResult-CO2dUnkp.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-tMtn9zsZ.js";
4
+ import { F as f, c as l } from "./FlightResult-CO2dUnkp.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.4.8",
3
+ "version": "0.4.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,246 +0,0 @@
1
- import { jsx as e, jsxs as n, Fragment as Y } from "react/jsx-runtime";
2
- import { RewardsService as Z, CashValue as R, EInvalidAmountDisplayOption as w } from "@odynn/awayz-core";
3
- import { useQuery as V } from "@tanstack/react-query";
4
- import { g as B } from "./index-7zRjF0bU.js";
5
- import { G as ii, g as $, E as d, F as ei, a as ri } from "./FlightItinerary-DWOexFxM.js";
6
- import { E as ni } from "./enums-B584l_96.js";
7
- import "./arrayExtensions-DFLvtO8l.js";
8
- import si, { useState as x, useMemo as ai } from "react";
9
- import { h as N } from "./moment-BGjjqtLQ.js";
10
- import { EPaymentType as u } from "./enums/EPaymentType.js";
11
- import { isSameDayFlight as ti } from "./utils/flightDateUtils.js";
12
- import { DEFAULT_AIRLINE_PROGRAM as oi, getFlightNumber as ci, getLogoPath as z, getAirlineProgram as li } from "./utils/flightUtils.js";
13
- import './assets/FlightResult.css';function mi(i) {
14
- if (!i || isNaN(i) || i < 0) return "N/A";
15
- let t = i == null ? void 0 : i.toString().split(".")[0];
16
- return t == null ? void 0 : t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
17
- }
18
- function G(i) {
19
- return ii({ 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);
20
- }
21
- const Ci = ({
22
- details: i,
23
- onClick: t,
24
- showBestValue: o = !1,
25
- onShowBestValueCalculation: s
26
- }) => {
27
- var O, T, b, A, E, I, S, L;
28
- const [P, U] = x(!1), m = i.origin, h = i.destination, D = i.flightDetails, C = i.paymentOptions || [], _ = C.filter((r) => r.points === -1).length === 1, j = C.filter((r) => r.points > -1).length === 1, [q, H] = x(oi), K = async () => {
29
- const r = await li(i.airlineProgram);
30
- H(r);
31
- }, { flightNumbers: v, airlines: Q } = ai(() => {
32
- const r = [], a = [];
33
- return i.flightDetails.slices.forEach((M) => {
34
- M.segments.forEach((g) => {
35
- const c = ci(g);
36
- r.includes(c) || r.push(c);
37
- const l = g.marketingCarrier, f = g.operatingCarrier;
38
- a.some((F) => F.airline === f.name) || a.push({
39
- logo: z(f.iataCode),
40
- airline: f.name
41
- }), l && f.name !== l.name && !a.some((F) => F.airline === l.name) && a.push({
42
- logo: z(l.iataCode),
43
- airline: l.name
44
- });
45
- });
46
- }), K(), { flightNumbers: r, airlines: a };
47
- }, [i.flightDetails.slices]), J = () => {
48
- i.cash > 0 ? t(i, u.CASH) : t(i, u.POINTS);
49
- }, W = !ti(
50
- i.departureTime,
51
- i.arrivalTime
52
- ), y = i == null ? void 0 : i.airlineProgram, { data: k } = V({
53
- queryKey: [ni.VALUE_CENTS, y],
54
- queryFn: () => Z.getPointsPerCent(y ?? ""),
55
- staleTime: 1 / 0,
56
- placeholderData: 0,
57
- enabled: !!y && o
58
- }), X = () => {
59
- var c;
60
- if (!i || !k || !i.points || !i.cash)
61
- return {
62
- pointsCashValue: 0,
63
- isBestValue: !1
64
- };
65
- const r = k * i.points / 100, a = ((c = i.cashFee) == null ? void 0 : c.amount) || 0;
66
- return {
67
- isPointsBestValue: r + a < i.cash
68
- };
69
- }, { isPointsBestValue: p } = X();
70
- return /* @__PURE__ */ e("div", { className: "flight-result", onClick: J, children: /* @__PURE__ */ n("div", { className: "content", children: [
71
- /* @__PURE__ */ e("div", { className: "flight-info", children: /* @__PURE__ */ n("div", { className: "flight-locations", children: [
72
- /* @__PURE__ */ e("div", { className: "airlines", children: Q.map((r, a) => /* @__PURE__ */ e(si.Fragment, { children: /* @__PURE__ */ n("div", { className: "tip", children: [
73
- /* @__PURE__ */ e("img", { src: r.logo, alt: r.airline }),
74
- /* @__PURE__ */ e("span", { className: "right", children: r.airline })
75
- ] }, a) }, a)) }),
76
- /* @__PURE__ */ n("div", { className: "flight-location", children: [
77
- /* @__PURE__ */ n("p", { className: "show-desktop", children: [
78
- m.city,
79
- ",",
80
- $(m.country)
81
- ] }),
82
- /* @__PURE__ */ e("p", { className: "show-desktop", children: N(i.departureTime).format(
83
- d.FlightShortDate
84
- ) }),
85
- /* @__PURE__ */ e("p", { className: "show-mobile", children: m.airportCode }),
86
- /* @__PURE__ */ e("p", { className: "show-mobile", children: N(i.departureTime).format(d.FlightTime) })
87
- ] }),
88
- /* @__PURE__ */ n("div", { className: "flight-duration", children: [
89
- /* @__PURE__ */ e("span", { className: "line" }),
90
- /* @__PURE__ */ n("p", { children: [
91
- B(D.slices[0].duration),
92
- " ",
93
- " - ",
94
- i.numberOfStops > 0 ? `${i.numberOfStops} Stop${i.numberOfStops > 1 ? "s" : ""}` : "Direct"
95
- ] }),
96
- /* @__PURE__ */ e("span", { className: "line" })
97
- ] }),
98
- /* @__PURE__ */ n("div", { children: [
99
- /* @__PURE__ */ n("p", { className: "show-desktop", children: [
100
- h.city,
101
- ", ",
102
- $(h.country)
103
- ] }),
104
- /* @__PURE__ */ n("p", { className: "show-desktop", children: [
105
- N(i.arrivalTime).format(
106
- d.FlightShortDate
107
- ),
108
- " "
109
- ] }),
110
- /* @__PURE__ */ e("p", { className: "show-mobile", children: h.airportCode }),
111
- /* @__PURE__ */ e("p", { className: "show-mobile", children: N(i.arrivalTime).format(d.FlightTime) })
112
- ] })
113
- ] }) }),
114
- /* @__PURE__ */ n("div", { className: "flight-footer", children: [
115
- /* @__PURE__ */ n("div", { className: "flight-detail-container", children: [
116
- /* @__PURE__ */ n(
117
- "div",
118
- {
119
- className: "flight-detail",
120
- onClick: (r) => {
121
- r.stopPropagation(), U(!P);
122
- },
123
- children: [
124
- /* @__PURE__ */ e("p", { children: "Aircraft" }),
125
- /* @__PURE__ */ n("p", { className: "chevron-text", children: [
126
- /* @__PURE__ */ e(ei, {}),
127
- /* @__PURE__ */ n("span", { children: [
128
- v[0],
129
- v.length > 1 && /* @__PURE__ */ n("sup", { children: [
130
- "+",
131
- v.length - 1
132
- ] })
133
- ] })
134
- ] })
135
- ]
136
- }
137
- ),
138
- i.cabinClass && /* @__PURE__ */ n("div", { className: "flight-detail", children: [
139
- /* @__PURE__ */ e("p", { children: "Class" }),
140
- /* @__PURE__ */ e("p", { children: i.cabinClass })
141
- ] })
142
- ] }),
143
- /* @__PURE__ */ n("div", { className: "booking-options ", children: [
144
- i.cash > 0 && /* @__PURE__ */ n(
145
- "div",
146
- {
147
- className: `amount-value ${!p && o ? "show-best-value-flag" : ""}`,
148
- onClick: (r) => {
149
- r.stopPropagation(), t(i, u.CASH);
150
- },
151
- children: [
152
- /* @__PURE__ */ e("img", { src: i.airlineLogo }),
153
- /* @__PURE__ */ n("div", { children: [
154
- /* @__PURE__ */ e("label", { children: _ ? "Book For" : "From" }),
155
- /* @__PURE__ */ e(
156
- R,
157
- {
158
- amount: i.cash,
159
- currency: i.currency
160
- }
161
- )
162
- ] }),
163
- !p && o && /* @__PURE__ */ n(
164
- "div",
165
- {
166
- className: "best-value-flag tip",
167
- onClick: (r) => {
168
- r.stopPropagation(), s == null || s(i);
169
- },
170
- children: [
171
- s && /* @__PURE__ */ e(G, {}),
172
- /* @__PURE__ */ e("p", { children: "Best Value" }),
173
- s && /* @__PURE__ */ e("span", { children: "Click to learn more" })
174
- ]
175
- }
176
- )
177
- ]
178
- }
179
- ),
180
- i.points > 0 && /* @__PURE__ */ n(
181
- "div",
182
- {
183
- className: `amount-value ${p && o ? "show-best-value-flag" : ""}`,
184
- onClick: (r) => {
185
- r.stopPropagation(), t(i, u.POINTS);
186
- },
187
- children: [
188
- p && o && /* @__PURE__ */ n(
189
- "div",
190
- {
191
- className: "best-value-flag tip",
192
- onClick: (r) => {
193
- r.stopPropagation(), s == null || s(i);
194
- },
195
- children: [
196
- s && /* @__PURE__ */ e(G, {}),
197
- /* @__PURE__ */ e("p", { children: "Best Value" }),
198
- s && /* @__PURE__ */ e("span", { children: "Click to learn more" })
199
- ]
200
- }
201
- ),
202
- /* @__PURE__ */ e("img", { src: q.programLogo }),
203
- /* @__PURE__ */ n("div", { children: [
204
- /* @__PURE__ */ e("label", { children: j ? "Book For" : "From" }),
205
- /* @__PURE__ */ n("p", { children: [
206
- `${mi(i.points)} miles`,
207
- ((O = i.cashFee) == null ? void 0 : O.amount) > 0 || (((A = (b = (T = i.paymentOptions) == null ? void 0 : T.find(
208
- (r) => r.points > -1
209
- )) == null ? void 0 : b.cashFee) == null ? void 0 : A.amount) ?? 0) > 0 && /* @__PURE__ */ n(Y, { children: [
210
- " + ",
211
- /* @__PURE__ */ e(
212
- R,
213
- {
214
- amount: ((I = (E = i.paymentOptions.find(
215
- (r) => r.points > -1
216
- )) == null ? void 0 : E.cashFee) == null ? void 0 : I.amount) ?? 0,
217
- currency: ((L = (S = i.paymentOptions.find(
218
- (r) => r.points > -1
219
- )) == null ? void 0 : S.cashFee) == null ? void 0 : L.currency) ?? "",
220
- customDisplay: "No fee",
221
- zeroDisplayOption: w.CUSTOM
222
- }
223
- )
224
- ] })
225
- ] })
226
- ] })
227
- ]
228
- }
229
- )
230
- ] })
231
- ] }),
232
- /* @__PURE__ */ e("div", { className: `flight-details ${P ? "is-open" : ""}`, children: /* @__PURE__ */ e("div", { className: "inner", children: /* @__PURE__ */ e(
233
- ri,
234
- {
235
- itinerary: D.slices[0].segments,
236
- origin: m,
237
- destination: h,
238
- isMultiDayFlight: W
239
- }
240
- ) }) })
241
- ] }) });
242
- };
243
- export {
244
- Ci as F,
245
- mi as c
246
- };