@odynn/awayz-flights 0.4.7 → 0.4.9

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.
@@ -1,94 +1,94 @@
1
- import { jsx as e, jsxs as n, Fragment as Q } from "react/jsx-runtime";
2
- import { RewardsService as J, CashValue as R, EInvalidAmountDisplayOption as W } from "@odynn/awayz-core";
3
- import { useQuery as X } from "@tanstack/react-query";
4
- import { g as Y } from "./index-7zRjF0bU.js";
5
- import { G as Z, g as $, E as d, F as ii, a as ei } from "./FlightItinerary-DWOexFxM.js";
6
- import { E as ri } from "./enums-B584l_96.js";
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
7
  import "./arrayExtensions-DFLvtO8l.js";
8
- import ni, { useState as w, useMemo as si } from "react";
9
- import { h as u } from "./moment-BGjjqtLQ.js";
10
- import { EPaymentType as N } from "./enums/EPaymentType.js";
11
- import { isSameDayFlight as ai } from "./utils/flightDateUtils.js";
12
- import { DEFAULT_AIRLINE_PROGRAM as oi, getFlightNumber as ti, getLogoPath as x, getAirlineProgram as ci } from "./utils/flightUtils.js";
13
- import './assets/FlightResult.css';function li(i) {
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
14
  if (!i || isNaN(i) || i < 0) return "N/A";
15
- let a = i == null ? void 0 : i.toString().split(".")[0];
16
- return a == null ? void 0 : a.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
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
17
  }
18
- function mi(i) {
19
- return Z({ 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);
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
20
  }
21
- const Di = ({
21
+ const Ci = ({
22
22
  details: i,
23
- onClick: a,
23
+ onClick: t,
24
24
  showBestValue: o = !1,
25
- onShowBestValueCalculation: t
25
+ onShowBestValueCalculation: s
26
26
  }) => {
27
- var T, b, k, A, S, E, I, L;
28
- const [P, z] = w(!1), m = i.origin, h = i.destination, C = i.flightDetails, D = i.paymentOptions || [], V = D.filter((r) => r.points === -1).length === 1, B = D.filter((r) => r.points > -1).length === 1, [G, U] = w(oi), _ = async () => {
29
- const r = await ci(i.airlineProgram);
30
- U(r);
31
- }, { flightNumbers: v, airlines: j } = si(() => {
32
- const r = [], s = [];
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
33
  return i.flightDetails.slices.forEach((M) => {
34
34
  M.segments.forEach((g) => {
35
- const c = ti(g);
35
+ const c = ci(g);
36
36
  r.includes(c) || r.push(c);
37
37
  const l = g.marketingCarrier, f = g.operatingCarrier;
38
- s.some((F) => F.airline === f.name) || s.push({
39
- logo: x(f.iataCode),
38
+ a.some((F) => F.airline === f.name) || a.push({
39
+ logo: z(f.iataCode),
40
40
  airline: f.name
41
- }), l && f.name !== l.name && !s.some((F) => F.airline === l.name) && s.push({
42
- logo: x(l.iataCode),
41
+ }), l && f.name !== l.name && !a.some((F) => F.airline === l.name) && a.push({
42
+ logo: z(l.iataCode),
43
43
  airline: l.name
44
44
  });
45
45
  });
46
- }), _(), { flightNumbers: r, airlines: s };
47
- }, [i.flightDetails.slices]), q = () => {
48
- i.cash > 0 ? a(i, N.CASH) : a(i, N.POINTS);
49
- }, H = !ai(
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
50
  i.departureTime,
51
51
  i.arrivalTime
52
- ), y = i == null ? void 0 : i.airlineProgram, { data: O } = X({
53
- queryKey: [ri.VALUE_CENTS, y],
54
- queryFn: () => J.getPointsPerCent(y ?? ""),
52
+ ), y = i == null ? void 0 : i.airlineProgram, { data: k } = V({
53
+ queryKey: [ni.VALUE_CENTS, y],
54
+ queryFn: () => Z.getPointsPerCent(y ?? ""),
55
55
  staleTime: 1 / 0,
56
56
  placeholderData: 0,
57
57
  enabled: !!y && o
58
- }), K = () => {
58
+ }), X = () => {
59
59
  var c;
60
- if (!i || !O || !i.points || !i.cash)
60
+ if (!i || !k || !i.points || !i.cash)
61
61
  return {
62
62
  pointsCashValue: 0,
63
63
  isBestValue: !1
64
64
  };
65
- const r = O * i.points / 100, s = ((c = i.cashFee) == null ? void 0 : c.amount) || 0;
65
+ const r = k * i.points / 100, a = ((c = i.cashFee) == null ? void 0 : c.amount) || 0;
66
66
  return {
67
- isPointsBestValue: r + s < i.cash
67
+ isPointsBestValue: r + a < i.cash
68
68
  };
69
- }, { isPointsBestValue: p } = K();
70
- return /* @__PURE__ */ e("div", { className: "flight-result", onClick: q, children: /* @__PURE__ */ n("div", { className: "content", children: [
69
+ }, { isPointsBestValue: p } = X();
70
+ return /* @__PURE__ */ e("div", { className: "flight-result", onClick: J, children: /* @__PURE__ */ n("div", { className: "content", children: [
71
71
  /* @__PURE__ */ e("div", { className: "flight-info", children: /* @__PURE__ */ n("div", { className: "flight-locations", children: [
72
- /* @__PURE__ */ e("div", { className: "airlines", children: j.map((r, s) => /* @__PURE__ */ e(ni.Fragment, { children: /* @__PURE__ */ n("div", { className: "tip", children: [
72
+ /* @__PURE__ */ e("div", { className: "airlines", children: Q.map((r, a) => /* @__PURE__ */ e(si.Fragment, { children: /* @__PURE__ */ n("div", { className: "tip", children: [
73
73
  /* @__PURE__ */ e("img", { src: r.logo, alt: r.airline }),
74
74
  /* @__PURE__ */ e("span", { className: "right", children: r.airline })
75
- ] }, s) }, s)) }),
75
+ ] }, a) }, a)) }),
76
76
  /* @__PURE__ */ n("div", { className: "flight-location", children: [
77
77
  /* @__PURE__ */ n("p", { className: "show-desktop", children: [
78
78
  m.city,
79
79
  ",",
80
80
  $(m.country)
81
81
  ] }),
82
- /* @__PURE__ */ e("p", { className: "show-desktop", children: u(i.departureTime).format(
82
+ /* @__PURE__ */ e("p", { className: "show-desktop", children: N(i.departureTime).format(
83
83
  d.FlightShortDate
84
84
  ) }),
85
85
  /* @__PURE__ */ e("p", { className: "show-mobile", children: m.airportCode }),
86
- /* @__PURE__ */ e("p", { className: "show-mobile", children: u(i.departureTime).format(d.FlightTime) })
86
+ /* @__PURE__ */ e("p", { className: "show-mobile", children: N(i.departureTime).format(d.FlightTime) })
87
87
  ] }),
88
88
  /* @__PURE__ */ n("div", { className: "flight-duration", children: [
89
89
  /* @__PURE__ */ e("span", { className: "line" }),
90
90
  /* @__PURE__ */ n("p", { children: [
91
- Y(C.slices[0].duration),
91
+ B(D.slices[0].duration),
92
92
  " ",
93
93
  " - ",
94
94
  i.numberOfStops > 0 ? `${i.numberOfStops} Stop${i.numberOfStops > 1 ? "s" : ""}` : "Direct"
@@ -102,13 +102,13 @@ const Di = ({
102
102
  $(h.country)
103
103
  ] }),
104
104
  /* @__PURE__ */ n("p", { className: "show-desktop", children: [
105
- u(i.arrivalTime).format(
105
+ N(i.arrivalTime).format(
106
106
  d.FlightShortDate
107
107
  ),
108
108
  " "
109
109
  ] }),
110
110
  /* @__PURE__ */ e("p", { className: "show-mobile", children: h.airportCode }),
111
- /* @__PURE__ */ e("p", { className: "show-mobile", children: u(i.arrivalTime).format(d.FlightTime) })
111
+ /* @__PURE__ */ e("p", { className: "show-mobile", children: N(i.arrivalTime).format(d.FlightTime) })
112
112
  ] })
113
113
  ] }) }),
114
114
  /* @__PURE__ */ n("div", { className: "flight-footer", children: [
@@ -118,12 +118,12 @@ const Di = ({
118
118
  {
119
119
  className: "flight-detail",
120
120
  onClick: (r) => {
121
- r.stopPropagation(), z(!P);
121
+ r.stopPropagation(), U(!P);
122
122
  },
123
123
  children: [
124
124
  /* @__PURE__ */ e("p", { children: "Aircraft" }),
125
125
  /* @__PURE__ */ n("p", { className: "chevron-text", children: [
126
- /* @__PURE__ */ e(ii, {}),
126
+ /* @__PURE__ */ e(ei, {}),
127
127
  /* @__PURE__ */ n("span", { children: [
128
128
  v[0],
129
129
  v.length > 1 && /* @__PURE__ */ n("sup", { children: [
@@ -144,14 +144,14 @@ const Di = ({
144
144
  i.cash > 0 && /* @__PURE__ */ n(
145
145
  "div",
146
146
  {
147
- className: `cash-value ${!p && o ? "show-best-value-flag" : ""}`,
147
+ className: `amount-value ${!p && o ? "show-best-value-flag" : ""}`,
148
148
  onClick: (r) => {
149
- r.stopPropagation(), a(i, N.CASH);
149
+ r.stopPropagation(), t(i, u.CASH);
150
150
  },
151
151
  children: [
152
152
  /* @__PURE__ */ e("img", { src: i.airlineLogo }),
153
153
  /* @__PURE__ */ n("div", { children: [
154
- /* @__PURE__ */ e("label", { children: V ? "Book For" : "From" }),
154
+ /* @__PURE__ */ e("label", { children: _ ? "Book For" : "From" }),
155
155
  /* @__PURE__ */ e(
156
156
  R,
157
157
  {
@@ -165,12 +165,12 @@ const Di = ({
165
165
  {
166
166
  className: "best-value-flag tip",
167
167
  onClick: (r) => {
168
- r.stopPropagation(), t == null || t(i);
168
+ r.stopPropagation(), s == null || s(i);
169
169
  },
170
170
  children: [
171
- t && /* @__PURE__ */ e(mi, {}),
171
+ s && /* @__PURE__ */ e(G, {}),
172
172
  /* @__PURE__ */ e("p", { children: "Best Value" }),
173
- t && /* @__PURE__ */ e("span", { children: "Click to learn more" })
173
+ s && /* @__PURE__ */ e("span", { children: "Click to learn more" })
174
174
  ]
175
175
  }
176
176
  )
@@ -180,32 +180,45 @@ const Di = ({
180
180
  i.points > 0 && /* @__PURE__ */ n(
181
181
  "div",
182
182
  {
183
- className: `points-value ${p && o ? "show-best-value-flag" : ""}`,
183
+ className: `amount-value ${p && o ? "show-best-value-flag" : ""}`,
184
184
  onClick: (r) => {
185
- r.stopPropagation(), a(i, N.POINTS);
185
+ r.stopPropagation(), t(i, u.POINTS);
186
186
  },
187
187
  children: [
188
- p && o && /* @__PURE__ */ e("div", { className: "best-value-flag", children: /* @__PURE__ */ e("p", { children: "Best Value" }) }),
189
- /* @__PURE__ */ e("img", { src: G.programLogo }),
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 }),
190
203
  /* @__PURE__ */ n("div", { children: [
191
- /* @__PURE__ */ e("label", { children: B ? "Book For" : "From" }),
204
+ /* @__PURE__ */ e("label", { children: j ? "Book For" : "From" }),
192
205
  /* @__PURE__ */ n("p", { children: [
193
- `${li(i.points)} miles`,
194
- ((T = i.cashFee) == null ? void 0 : T.amount) > 0 || (((A = (k = (b = i.paymentOptions) == null ? void 0 : b.find(
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(
195
208
  (r) => r.points > -1
196
- )) == null ? void 0 : k.cashFee) == null ? void 0 : A.amount) ?? 0) > 0 && /* @__PURE__ */ n(Q, { children: [
209
+ )) == null ? void 0 : b.cashFee) == null ? void 0 : A.amount) ?? 0) > 0 && /* @__PURE__ */ n(Y, { children: [
197
210
  " + ",
198
211
  /* @__PURE__ */ e(
199
212
  R,
200
213
  {
201
- amount: ((E = (S = i.paymentOptions.find(
214
+ amount: ((I = (E = i.paymentOptions.find(
202
215
  (r) => r.points > -1
203
- )) == null ? void 0 : S.cashFee) == null ? void 0 : E.amount) ?? 0,
204
- currency: ((L = (I = i.paymentOptions.find(
216
+ )) == null ? void 0 : E.cashFee) == null ? void 0 : I.amount) ?? 0,
217
+ currency: ((L = (S = i.paymentOptions.find(
205
218
  (r) => r.points > -1
206
- )) == null ? void 0 : I.cashFee) == null ? void 0 : L.currency) ?? "",
219
+ )) == null ? void 0 : S.cashFee) == null ? void 0 : L.currency) ?? "",
207
220
  customDisplay: "No fee",
208
- zeroDisplayOption: W.CUSTOM
221
+ zeroDisplayOption: w.CUSTOM
209
222
  }
210
223
  )
211
224
  ] })
@@ -217,17 +230,17 @@ const Di = ({
217
230
  ] })
218
231
  ] }),
219
232
  /* @__PURE__ */ e("div", { className: `flight-details ${P ? "is-open" : ""}`, children: /* @__PURE__ */ e("div", { className: "inner", children: /* @__PURE__ */ e(
220
- ei,
233
+ ri,
221
234
  {
222
- itinerary: C.slices[0].segments,
235
+ itinerary: D.slices[0].segments,
223
236
  origin: m,
224
237
  destination: h,
225
- isMultiDayFlight: H
238
+ isMultiDayFlight: W
226
239
  }
227
240
  ) }) })
228
241
  ] }) });
229
242
  };
230
243
  export {
231
- Di as F,
232
- li as c
244
+ Ci as F,
245
+ mi as c
233
246
  };
@@ -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.cash-value{position:relative}.flight-result .content>div.flight-footer .booking-options>div.cash-value .currency-conversion{display:flex}.flight-result .content>div.flight-footer .booking-options>div.cash-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.cash-value .best-value-flag p{color:var(--foreground, #fff)}.flight-result .content>div.flight-footer .booking-options>div.cash-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)}.flight-result .content>div.flight-footer .booking-options>div.points-value{position:relative}.flight-result .content>div.flight-footer .booking-options>div.points-value .best-value-flag{position:absolute;right:1rem;top:-.8rem;border:1px solid #1495f2;border-radius:.5rem;background-color:#5cb6f6}.flight-result .content>div.flight-footer .booking-options>div.points-value .best-value-flag p{font-size:600;padding:.25rem .5rem;color:var(--foreground, #fff)}.flight-result .content>div.flight-footer .booking-options>div.points-value.show-best-value-flag{border-color:#1495f2}@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.points-value{text-align:center}.flight-result .content>div.flight-footer .booking-options>div.points-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-CDKN24kZ.js";
5
+ import { F as u } from "../../FlightResult-tMtn9zsZ.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-CDKN24kZ.js";
1
+ import { F as l } from "../FlightResult-tMtn9zsZ.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-CDKN24kZ.js";
4
+ import { F as f, c as l } from "./FlightResult-tMtn9zsZ.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.7",
3
+ "version": "0.4.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"