@odynn/awayz-flights 0.1.26 → 0.1.27

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.
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as c, Fragment as B } from "react/jsx-runtime";
2
2
  import g, { useMemo as k } from "react";
3
3
  import { l as G, h as A } from "./arrayExtensions-DWKenJCh.js";
4
4
  import { ECabinClass as I } from "./types/enums.js";
5
- import { a as E, b as Z, d as V } from "./dateUtils-vgrvV5fG.js";
5
+ import { a as E, b as V, d as Z } from "./dateUtils-DeNLG5hw.js";
6
6
  import { DUFFEL_ASSET_PATH as K } from "./constants/constants.js";
7
7
  import './assets/FlightItinerary.css';const w = (e) => {
8
8
  var t;
@@ -82,7 +82,7 @@ function ee(e, t) {
82
82
  if (typeof e != "object" || !e) return e;
83
83
  var r = e[Symbol.toPrimitive];
84
84
  if (r !== void 0) {
85
- var i = r.call(e, t);
85
+ var i = r.call(e, t || "default");
86
86
  if (typeof i != "object") return i;
87
87
  throw new TypeError("@@toPrimitive must return a primitive value.");
88
88
  }
@@ -122,13 +122,13 @@ function te(e) {
122
122
  return z !== void 0 ? /* @__PURE__ */ g.createElement(z.Consumer, null, (r) => t(r)) : t(U);
123
123
  }
124
124
  function $(e) {
125
- return F({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12 192h424c6.6 0 12 5.4 12 12v260c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V204c0-6.6 5.4-12 12-12zm436-44v-36c0-26.5-21.5-48-48-48h-48V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H160V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v36c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12z" }, child: [] }] })(e);
125
+ return F({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12 192h424c6.6 0 12 5.4 12 12v260c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V204c0-6.6 5.4-12 12-12zm436-44v-36c0-26.5-21.5-48-48-48h-48V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H160V12c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v36c0 6.6 5.4 12 12 12h424c6.6 0 12-5.4 12-12z" }, child: [] }] })(e);
126
126
  }
127
127
  function me(e) {
128
- return F({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" }, child: [] }] })(e);
128
+ return F({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" }, child: [] }] })(e);
129
129
  }
130
130
  function re(e) {
131
- return F({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z" }, child: [] }] })(e);
131
+ return F({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z" }, child: [] }] })(e);
132
132
  }
133
133
  const se = ({
134
134
  itinerary: e,
@@ -139,15 +139,15 @@ const se = ({
139
139
  }) => {
140
140
  var d, l, v, D, y, j;
141
141
  const m = () => I.ECONOMY, p = k(() => {
142
- var f, b, C, O, T, M, N;
142
+ var h, b, C, O, T, M, N;
143
143
  const n = [];
144
- for (let h = 0; h < e.length; h++) {
145
- const u = e[h], s = e[h + 1];
144
+ for (let f = 0; f < e.length; f++) {
145
+ const u = e[f], s = e[f + 1];
146
146
  if (!s)
147
147
  break;
148
148
  const x = {
149
149
  arrival: {
150
- airport: (f = u.destination) == null ? void 0 : f.name,
150
+ airport: (h = u.destination) == null ? void 0 : h.name,
151
151
  city: (b = u.destination) == null ? void 0 : b.cityName,
152
152
  country: w((C = u.destination) == null ? void 0 : C.iataCountryCode),
153
153
  time: u.arrivingAt,
@@ -196,8 +196,8 @@ const se = ({
196
196
  isMultiDayFlight: o
197
197
  }
198
198
  ),
199
- p.map((n, f) => {
200
- var b, C, O, T, M, N, h, u;
199
+ p.map((n, h) => {
200
+ var b, C, O, T, M, N, f, u;
201
201
  return /* @__PURE__ */ a(g.Fragment, { children: [
202
202
  /* @__PURE__ */ c(
203
203
  L,
@@ -222,16 +222,16 @@ const se = ({
222
222
  country: (O = n.departure) == null ? void 0 : O.country,
223
223
  departureAt: n.departure.time,
224
224
  departureTimeZone: n.departure.departureTimeZone,
225
- arrivalAt: e[f + 1].arrivingAt,
226
- arrivalTimeZone: e[f + 1].destination.timeZone,
225
+ arrivalAt: e[h + 1].arrivingAt,
226
+ arrivalTimeZone: e[h + 1].destination.timeZone,
227
227
  airline: (T = n.departure) == null ? void 0 : T.airline,
228
228
  airlineCode: (M = n.departure) == null ? void 0 : M.airlineCode,
229
229
  aircraft: (N = n.departure) == null ? void 0 : N.aircraft,
230
- flightNumber: (h = n.departure) == null ? void 0 : h.flightNumber,
230
+ flightNumber: (f = n.departure) == null ? void 0 : f.flightNumber,
231
231
  cabin: (u = n.departure) == null ? void 0 : u.cabin
232
232
  }
233
233
  )
234
- ] }, n.departure.flightNumber || f);
234
+ ] }, n.departure.flightNumber || h);
235
235
  }),
236
236
  /* @__PURE__ */ c(
237
237
  L,
@@ -1,9 +1,9 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../arrayExtensions-DWKenJCh.js";
4
- import { a as f } from "../../FlightItinerary-C-fQZjL3.js";
4
+ import { a as f } from "../../FlightItinerary-DgpK1LYF.js";
5
5
  import "../../types/enums.js";
6
- import "../../dateUtils-vgrvV5fG.js";
6
+ import "../../dateUtils-DeNLG5hw.js";
7
7
  import "../../constants/constants.js";
8
8
  export {
9
9
  f as default
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
2
  import O, { useState as d, useMemo as E } from "react";
3
- import { g as f, E as N, F as I, a as M } from "../../FlightItinerary-C-fQZjL3.js";
3
+ import { g as f, E as N, F as I, a as M } from "../../FlightItinerary-DgpK1LYF.js";
4
4
  import { DEFAULT_AIRLINE_PROGRAM as R, getFlightNumber as T, getLogoPath as B, getAirlineProgram as L } from "../../utils/flightUtils.js";
5
5
  import { h as u } from "../../arrayExtensions-DWKenJCh.js";
6
- import { g as $ } from "../../dateUtils-vgrvV5fG.js";
6
+ import { g as $ } from "../../dateUtils-DeNLG5hw.js";
7
7
  import { EPaymentType as v } from "../../enums/EPaymentType.js";
8
8
  import '../../assets/FlightResult.css';function b(i) {
9
9
  if (!i || isNaN(i) || i < 0) return "N/A";
@@ -49,8 +49,8 @@ const $ = (n, e) => {
49
49
  };
50
50
  export {
51
51
  M as a,
52
- $ as b,
52
+ l as b,
53
53
  g as c,
54
- l as d,
54
+ $ as d,
55
55
  T as g
56
56
  };
@@ -89,7 +89,7 @@ var oe = function(o, t) {
89
89
  };
90
90
  const L = "text/event-stream", se = 1e3, M = "last-event-id";
91
91
  function ae(o, t) {
92
- var { signal: r, headers: n, onopen: s, onmessage: O, onclose: c, onerror: u, openWhenHidden: a, fetch: d } = t, b = oe(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
92
+ var { signal: r, headers: n, onopen: s, onmessage: v, onclose: c, onerror: u, openWhenHidden: a, fetch: d } = t, b = oe(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
93
93
  return new Promise((g, D) => {
94
94
  const p = Object.assign({}, n);
95
95
  p.accept || (p.accept = L);
@@ -115,7 +115,7 @@ function ae(o, t) {
115
115
  h ? p[M] = h : delete p[M];
116
116
  }, (h) => {
117
117
  I = h;
118
- }, O))), c == null || c(), S(), g();
118
+ }, v))), c == null || c(), S(), g();
119
119
  } catch (w) {
120
120
  if (!m.signal.aborted)
121
121
  try {
@@ -141,8 +141,8 @@ const W = 1, U = J.ECONOMY, z = new AbortController(), ue = 3 * 60 * 1e3, B = (o
141
141
  throw new Error("Departure date is required.");
142
142
  if (o.flightType === Y.ROUND_TRIP && !o.returnDate)
143
143
  throw new Error("Return date is required for round-trip flights.");
144
- }, ve = () => {
145
- const { token: o, config: t } = X(), [r, n] = N(""), [s, O] = N([]), [c, u] = N(!1), a = $(null), {
144
+ }, Oe = () => {
145
+ const { token: o, config: t } = X(), [r, n] = N(""), [s, v] = N([]), [c, u] = N(!1), a = $(null), {
146
146
  inboundResults: d,
147
147
  outboundResults: b,
148
148
  setInboundResults: g,
@@ -247,7 +247,7 @@ const W = 1, U = J.ECONOMY, z = new AbortController(), ue = 3 * 60 * 1e3, B = (o
247
247
  const { success: l, data: f } = e;
248
248
  if (!l) return;
249
249
  const i = f.offers;
250
- O(x(i));
250
+ v(x(i));
251
251
  },
252
252
  onError: (e) => {
253
253
  console.error("Error in round-trip fare search:", e);
@@ -275,21 +275,21 @@ const W = 1, U = J.ECONOMY, z = new AbortController(), ue = 3 * 60 * 1e3, B = (o
275
275
  signal: z.signal,
276
276
  onmessage(F) {
277
277
  try {
278
- const v = x(JSON.parse(F.data));
279
- if (v.success === !1) {
278
+ const O = x(JSON.parse(F.data));
279
+ if (O.success === !1) {
280
280
  C();
281
281
  return;
282
282
  }
283
- if (v.close === !0) {
283
+ if (O.close === !0) {
284
284
  C();
285
285
  return;
286
286
  }
287
- v.flights && (i = y({
288
- data: v.flights,
287
+ O.flights && (i = y({
288
+ data: O.flights,
289
289
  previousResults: i
290
290
  }));
291
- } catch (v) {
292
- console.error("Error parsing message:", v), C();
291
+ } catch (O) {
292
+ console.error("Error parsing message:", O), C();
293
293
  }
294
294
  },
295
295
  onerror(F) {
@@ -361,5 +361,5 @@ const W = 1, U = J.ECONOMY, z = new AbortController(), ue = 3 * 60 * 1e3, B = (o
361
361
  };
362
362
  };
363
363
  export {
364
- ve as useFlightSearch
364
+ Oe as useFlightSearch
365
365
  };
@@ -1,27 +1,27 @@
1
- import a from "react";
2
- const l = (e) => {
1
+ import i from "react";
2
+ const d = (e) => {
3
3
  let t;
4
- const s = /* @__PURE__ */ new Set(), u = (n, r) => {
4
+ const s = /* @__PURE__ */ new Set(), c = (n, a) => {
5
5
  const o = typeof n == "function" ? n(t) : n;
6
6
  if (!Object.is(o, t)) {
7
- const d = t;
8
- t = r ?? (typeof o != "object" || o === null) ? o : Object.assign({}, t, o), s.forEach((f) => f(t, d));
7
+ const S = t;
8
+ t = a ?? (typeof o != "object" || o === null) ? o : Object.assign({}, t, o), s.forEach((b) => b(t, S));
9
9
  }
10
- }, c = () => t, i = { setState: u, getState: c, getInitialState: () => S, subscribe: (n) => (s.add(n), () => s.delete(n)) }, S = t = e(u, c, i);
11
- return i;
12
- }, g = (e) => e ? l(e) : l, I = (e) => e;
13
- function R(e, t = I) {
14
- const s = a.useSyncExternalStore(
10
+ }, u = () => t, r = { setState: c, getState: u, getInitialState: () => l, subscribe: (n) => (s.add(n), () => s.delete(n)) }, l = t = e(c, u, r);
11
+ return r;
12
+ }, f = (e) => d(e), g = (e) => e;
13
+ function I(e, t = g) {
14
+ const s = i.useSyncExternalStore(
15
15
  e.subscribe,
16
16
  () => t(e.getState()),
17
17
  () => t(e.getInitialState())
18
18
  );
19
- return a.useDebugValue(s), s;
19
+ return i.useDebugValue(s), s;
20
20
  }
21
- const b = (e) => {
22
- const t = g(e), s = (u) => R(t, u);
21
+ const R = (e) => {
22
+ const t = f(e), s = (c) => I(t, c);
23
23
  return Object.assign(s, t), s;
24
- }, O = (e) => e ? b(e) : b, y = O((e) => ({
24
+ }, O = (e) => R(e), y = O((e) => ({
25
25
  outboundResults: [],
26
26
  inboundResults: [],
27
27
  setOutboundResults: (t) => e({ outboundResults: t }),
@@ -1,17 +1,17 @@
1
1
  import { h as f } from "../arrayExtensions-DWKenJCh.js";
2
- import { c as R } from "../dateUtils-vgrvV5fG.js";
2
+ import { c as R } from "../dateUtils-DeNLG5hw.js";
3
3
  import "react";
4
4
  import { awayzClient as K } from "@odynn/awayz-auth";
5
5
  import { WalletService as j } from "../services/wallet/WalletService.js";
6
6
  import { ERewardProgramCategories as q } from "../services/wallet/WalletService.types.js";
7
- const B = (s) => s == null ? void 0 : s.map((e) => {
8
- var c, a, i, n, t, o, g, r, d, A, M, I, F, L, w, u, y, l, C, h, b, m, p, D, T, k, z, v, O, G, _, $, Z, P;
7
+ const B = (i) => i == null ? void 0 : i.map((e) => {
8
+ var c, a, s, n, t, o, g, r, d, A, M, I, F, L, w, u, y, l, C, h, b, m, p, D, T, k, z, v, O, G, _, $, Z, P;
9
9
  return {
10
10
  id: e.id,
11
11
  points: (e == null ? void 0 : e.points) >= 0 ? e.points : -1,
12
12
  partial: e == null ? void 0 : e.partial,
13
13
  origin: {
14
- city: ((c = e.slices[0].segments[0].origin) == null ? void 0 : c.cityName) || ((i = (a = e.slices[0].segments[0].origin) == null ? void 0 : a.city) == null ? void 0 : i.name),
14
+ city: ((c = e.slices[0].segments[0].origin) == null ? void 0 : c.cityName) || ((s = (a = e.slices[0].segments[0].origin) == null ? void 0 : a.city) == null ? void 0 : s.name),
15
15
  country: ((n = e.slices[0].segments[0].origin) == null ? void 0 : n.iataCountryCode) || ((o = (t = e.slices[0].segments[0].origin) == null ? void 0 : t.city) == null ? void 0 : o.iataCountryCode),
16
16
  airportCode: ((g = e.slices[0].segments[0].origin) == null ? void 0 : g.iataCityCode) || ((d = (r = e.slices[0].segments[0].origin) == null ? void 0 : r.city) == null ? void 0 : d.iataCode),
17
17
  coordinates: {
@@ -49,11 +49,11 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
49
49
  duration: e.slices[0].duration
50
50
  })
51
51
  };
52
- }), J = (s, e) => {
52
+ }), J = (i, e) => {
53
53
  if (!(e != null && e.length))
54
- return B(s);
55
- const c = [...e], a = [], i = {};
56
- for (const t of s) {
54
+ return B(i);
55
+ const c = [...e], a = [], s = {};
56
+ for (const t of i) {
57
57
  const o = t.slices[0].segments, g = o[0], r = {
58
58
  iataCode: g.operatingCarrier.iataCode,
59
59
  flightNumber: N(
@@ -72,7 +72,7 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
72
72
  )))
73
73
  return !1;
74
74
  let m = !1;
75
- return (L && F && l.awayzMatchId === A || !h && l.awayzMatchId === M || F && !L && l.awayzMarketerMatchId === I) && (m = !0), m && (i[l.id] = y), m;
75
+ return (L && F && l.awayzMatchId === A || !h && l.awayzMatchId === M || F && !L && l.awayzMarketerMatchId === I) && (m = !0), m && (s[l.id] = y), m;
76
76
  });
77
77
  if (w.length) {
78
78
  t.slices[0].comparisonKey = w[0].awayzGroupId;
@@ -84,7 +84,7 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
84
84
  d.iataCode === "AC" && ((m = C.split(" ")) == null ? void 0 : m[0]) === ((p = l.split(" ")) == null ? void 0 : p[0]);
85
85
  });
86
86
  if (u) {
87
- const y = i[u.id], l = {
87
+ const y = s[u.id], l = {
88
88
  ...t,
89
89
  ...u,
90
90
  points: t.points,
@@ -103,33 +103,33 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
103
103
  a.push(t);
104
104
  }
105
105
  return [
106
- ...c ?? [],
106
+ ...c,
107
107
  ...B(a) ?? []
108
108
  ];
109
- }, U = (s) => {
110
- const e = s.operatingCarrierFlightNumber ? s.operatingCarrier : s.marketingCarrier, c = s.operatingCarrierFlightNumber ?? s.marketingCarrierFlightNumber;
109
+ }, U = (i) => {
110
+ const e = i.operatingCarrierFlightNumber ? i.operatingCarrier : i.marketingCarrier, c = i.operatingCarrierFlightNumber ?? i.marketingCarrierFlightNumber;
111
111
  return e.iataCode + " " + N(c);
112
112
  }, X = ({
113
- originCode: s,
113
+ originCode: i,
114
114
  destinationCode: e,
115
115
  departureDate: c,
116
116
  cabinClass: a,
117
- passengerCount: i,
117
+ passengerCount: s,
118
118
  paymentType: n
119
119
  }) => {
120
120
  let t = "/flights/search/one-way/points-cash?";
121
- return t += `origin=${s}`, t += `&destination=${e}`, t += `&departure_date=${c}`, t += `&cabin_class=${a}`, t += `&adults=${i}`, t += `&cash_or_points=[${n}]`, t;
122
- }, ee = (s) => {
123
- const e = s.reduce((a, i) => {
124
- const n = i.flightDetails.slices[0].segments.map((t) => N(U(t))).join("_");
125
- return a[n] || (a[n] = []), a[n].push(i), a;
121
+ return t += `origin=${i}`, t += `&destination=${e}`, t += `&departure_date=${c}`, t += `&cabin_class=${a}`, t += `&adults=${s}`, t += `&cash_or_points=[${n}]`, t;
122
+ }, ee = (i) => {
123
+ const e = i.reduce((a, s) => {
124
+ const n = s.flightDetails.slices[0].segments.map((t) => N(U(t))).join("_");
125
+ return a[n] || (a[n] = []), a[n].push(s), a;
126
126
  }, {});
127
127
  return Object.values(e).map(
128
128
  (a) => {
129
- const i = a[0], { origin: n, destination: t } = i, o = a.filter((r) => r.cash > 0).reduce((r, d) => Math.min(r, d.cash), 1 / 0), g = a.filter((r) => r.points > 0).reduce((r, d) => Math.min(r, d.points), 1 / 0);
129
+ const s = a[0], { origin: n, destination: t } = s, o = a.filter((r) => r.cash > 0).reduce((r, d) => Math.min(r, d.cash), 1 / 0), g = a.filter((r) => r.points > 0).reduce((r, d) => Math.min(r, d.points), 1 / 0);
130
130
  return {
131
- id: i.awayzGroupId,
132
- partial: i.partial,
131
+ id: s.awayzGroupId,
132
+ partial: s.partial,
133
133
  origin: {
134
134
  city: n.city,
135
135
  country: n.country,
@@ -142,8 +142,8 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
142
142
  airportCode: t.airportCode,
143
143
  coordinates: t.coordinates
144
144
  },
145
- airline: i.airline,
146
- flightNumber: i.flightNumber,
145
+ airline: s.airline,
146
+ flightNumber: s.flightNumber,
147
147
  paymentOptions: a.map((r) => ({
148
148
  id: r.id,
149
149
  cash: r.cash,
@@ -163,30 +163,30 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
163
163
  name: r.flightDetails.slices[0].segments[0].marketingCarrier.name
164
164
  }
165
165
  })),
166
- numberOfStops: i.numberOfStops,
167
- departureTime: i.departureTime,
168
- arrivalTime: i.arrivalTime,
169
- awayzGroupId: i.awayzGroupId,
170
- duration: i.duration,
171
- airlineProgram: i.airlineProgram,
166
+ numberOfStops: s.numberOfStops,
167
+ departureTime: s.departureTime,
168
+ arrivalTime: s.arrivalTime,
169
+ awayzGroupId: s.awayzGroupId,
170
+ duration: s.duration,
171
+ airlineProgram: s.airlineProgram,
172
172
  durationMinutes: R({
173
173
  departureTime: f(
174
- i.flightDetails.slices[0].segments[0].departingAt
174
+ s.flightDetails.slices[0].segments[0].departingAt
175
175
  ),
176
176
  arrivalTime: f(
177
- i.flightDetails.slices[0].segments.getLast().arrivingAt
177
+ s.flightDetails.slices[0].segments.getLast().arrivingAt
178
178
  ),
179
- originTimeZone: i.flightDetails.slices[0].segments[0].origin.timeZone,
180
- destinationTimeZone: i.flightDetails.slices[0].segments.getLast().destination.timeZone,
181
- duration: i.flightDetails.slices[0].duration
179
+ originTimeZone: s.flightDetails.slices[0].segments[0].origin.timeZone,
180
+ destinationTimeZone: s.flightDetails.slices[0].segments.getLast().destination.timeZone,
181
+ duration: s.flightDetails.slices[0].duration
182
182
  }),
183
183
  cash: o === 1 / 0 ? -1 : o,
184
184
  points: g === 1 / 0 ? -1 : g,
185
- flightDetails: i.flightDetails
185
+ flightDetails: s.flightDetails
186
186
  };
187
187
  }
188
188
  );
189
- }, N = (s) => s.replace(/^0+/, ""), te = (s) => `https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/${s}.svg`, S = "/img/logo/odynn-eye.svg", E = {
189
+ }, N = (i) => i ? i.replace(/^0+/, "") : "", te = (i) => `https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/${i}.svg`, S = "/img/logo/odynn-eye.svg", E = {
190
190
  categoryLogo: S,
191
191
  programLogo: S,
192
192
  awayzActive: [],
@@ -198,7 +198,7 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
198
198
  colour: "#fff",
199
199
  // Using App Foreground Colour
200
200
  url: "https://www.odynn.com"
201
- }, ie = async (s) => {
201
+ }, ie = async (i) => {
202
202
  const { airlines: e } = await K.ensureQueryData({
203
203
  queryKey: ["walletAwards"],
204
204
  queryFn: j.getAwards,
@@ -207,15 +207,15 @@ const B = (s) => s == null ? void 0 : s.map((e) => {
207
207
  });
208
208
  let c = e.find(
209
209
  (a) => {
210
- var i, n, t, o;
211
- return ((n = (i = a.mainProgram) == null ? void 0 : i.toLowerCase()) == null ? void 0 : n.includes(s == null ? void 0 : s.toLowerCase())) || ((o = (t = a.displayProgram) == null ? void 0 : t.toLowerCase()) == null ? void 0 : o.includes(s == null ? void 0 : s.toLowerCase()));
210
+ var s, n, t, o;
211
+ return ((n = (s = a.mainProgram) == null ? void 0 : s.toLowerCase()) == null ? void 0 : n.includes(i == null ? void 0 : i.toLowerCase())) || ((o = (t = a.displayProgram) == null ? void 0 : t.toLowerCase()) == null ? void 0 : o.includes(i == null ? void 0 : i.toLowerCase()));
212
212
  }
213
213
  ) ?? E;
214
214
  return c || (c = {
215
215
  ...E,
216
- mainProgram: s,
217
- displayProgram: s,
218
- id: s
216
+ mainProgram: i,
217
+ displayProgram: i,
218
+ id: i
219
219
  }), c;
220
220
  };
221
221
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-flights",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"