@odynn/awayz-core 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TripsService-A25R9nj7.js → TripsService-ByimRRRe.js} +1 -1
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +1 -1
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
- package/dist/components/CashValue/CashValue.js +6 -7
- package/dist/components/CashValue/CashValue.stories.js +19 -20
- package/dist/components/ClientPointsValue/ClientPointsValue.js +39 -247
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Wallet/Card/Card.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +11 -12
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +64 -65
- package/dist/hooks/useBookingManagement/useBookingManagement.js +8 -9
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +3 -4
- package/dist/hooks/useFeatureFlags.js +1 -1
- package/dist/hooks/useSearchLimit.js +11 -12
- package/dist/hooks/useTripManagement/useTripManagement.js +5 -6
- package/dist/hooks/useTripManagement/useTripManagement.test.js +3 -4
- package/dist/hooks/useWallet/useWallet.js +24 -25
- package/dist/hooks/useWallet/useWallet.test.js +2 -3
- package/dist/{index-jyHfrLRo.js → index-C8p5kinH.js} +18 -18
- package/dist/main.js +1 -1
- package/dist/{noRetryInstance-CNXX0Siw.js → noRetryInstance-oiHCni_Z.js} +465 -463
- package/dist/providers/AwayzProvider.js +7 -8
- package/dist/services/account/AccountService.js +2 -3
- package/dist/services/bookings/BookingService.js +1 -1
- package/dist/services/currency/CurrencyService.js +12 -13
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +9 -10
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +1 -1
- package/dist/services/trips/TripsService.js +2 -2
- package/dist/services/wallet/WalletService.js +1 -1
- package/package.json +1 -1
- package/dist/RewardsService-CB88je4D.js +0 -118952
- package/dist/assets/ClientPointsValue.css +0 -1
- package/dist/assets/RewardsService.css +0 -1
|
@@ -2,7 +2,7 @@ var m = Object.defineProperty;
|
|
|
2
2
|
var g = (r, e, s) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
|
|
3
3
|
var t = (r, e, s) => g(r, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import "./arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { c as n,
|
|
5
|
+
import { c as n, f as p, b as c, r as T } from "./noRetryInstance-oiHCni_Z.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EMyTripsEndpoints as i } from "./configs/endpoints.js";
|
|
8
8
|
import { EBookingType as l } from "./services/trips/TripService.types.js";
|
|
@@ -4,7 +4,7 @@ import { E as o } from "../../../DateFormats-DZD30Nea.js";
|
|
|
4
4
|
import { E as r } from "../../../_styles.flight-booking-DEUJthTJ.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { useTranslation as E } from "react-i18next";
|
|
7
|
-
import { F as D } from "../../../index-
|
|
7
|
+
import { F as D } from "../../../index-C8p5kinH.js";
|
|
8
8
|
import M from "../../Menu/Menu.js";
|
|
9
9
|
const U = ({
|
|
10
10
|
airlines: s,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { G as N, c as u } from "../../../index-
|
|
2
|
+
import { G as N, c as u } from "../../../index-C8p5kinH.js";
|
|
3
3
|
import { h as $ } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { E as f } from "../../../DateFormats-DZD30Nea.js";
|
|
5
5
|
import "react";
|
|
@@ -2,22 +2,21 @@ import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQuery as E } from "@tanstack/react-query";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { g as R, a as N, b as u } from "../../cashUtils-sBirmFfL.js";
|
|
5
|
-
import { E as _ } from "../../
|
|
5
|
+
import { E as _ } from "../../noRetryInstance-oiHCni_Z.js";
|
|
6
6
|
import { useMemo as S } from "react";
|
|
7
|
-
import { a as f } from "../../index-
|
|
7
|
+
import { a as f } from "../../index-C8p5kinH.js";
|
|
8
8
|
import "react-i18next";
|
|
9
9
|
import '../../assets/_styles3.css';import '../../assets/_styles.css';import '../../assets/_styles2.css';/* empty css */
|
|
10
10
|
import "../../_styles.flight-booking-DEUJthTJ.js";
|
|
11
11
|
/* empty css */
|
|
12
12
|
import { EInvalidAmountDisplayOption as o, EToolTipPosition as T } from "./CashValueTypes.js";
|
|
13
|
-
/* empty css */
|
|
14
|
-
import "../../configs/awayzClient.js";
|
|
15
13
|
import { useAwayzContext as D } from "../../hooks/useAwayzContext.js";
|
|
16
|
-
import "../../
|
|
14
|
+
import "../../configs/awayzClient.js";
|
|
15
|
+
/* empty css */
|
|
17
16
|
import "../../context/AwayzContext.js";
|
|
18
17
|
import { CurrencyService as I } from "../../services/currency/CurrencyService.js";
|
|
19
18
|
import { Tooltip as M } from "../Tooltip/Tooltip.js";
|
|
20
|
-
const O = 1e3 * 60 * 60,
|
|
19
|
+
const O = 1e3 * 60 * 60, G = ({
|
|
21
20
|
amount: t,
|
|
22
21
|
currency: n,
|
|
23
22
|
position: y = T.RIGHT,
|
|
@@ -110,6 +109,6 @@ const O = 1e3 * 60 * 60, k = ({
|
|
|
110
109
|
] });
|
|
111
110
|
};
|
|
112
111
|
export {
|
|
113
|
-
|
|
112
|
+
G as CashValue,
|
|
114
113
|
O as CurrencyCallStaleTimeMs
|
|
115
114
|
};
|
|
@@ -7,15 +7,14 @@ import "../../_styles.flight-booking-DEUJthTJ.js";
|
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { CashValue as n } from "./CashValue.js";
|
|
9
9
|
import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
|
|
10
|
-
import "../../RewardsService-CB88je4D.js";
|
|
11
10
|
import "@tanstack/react-query";
|
|
12
|
-
/* empty css */
|
|
13
|
-
import "../../configs/awayzClient.js";
|
|
14
11
|
import "../../context/AwayzContext.js";
|
|
15
|
-
import "../../noRetryInstance-
|
|
12
|
+
import "../../noRetryInstance-oiHCni_Z.js";
|
|
13
|
+
import "../../configs/awayzClient.js";
|
|
14
|
+
/* empty css */
|
|
16
15
|
import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
|
|
17
16
|
import { EAuthFlow as i } from "../../types/EAuthFlow.js";
|
|
18
|
-
const
|
|
17
|
+
const f = {
|
|
19
18
|
title: "Core/Cash Value",
|
|
20
19
|
component: n,
|
|
21
20
|
parameters: {
|
|
@@ -58,46 +57,46 @@ const h = {
|
|
|
58
57
|
}
|
|
59
58
|
)
|
|
60
59
|
]
|
|
61
|
-
},
|
|
60
|
+
}, h = {
|
|
62
61
|
name: "Euro to Dollar Cash Value",
|
|
63
62
|
args: {
|
|
64
63
|
amount: 100,
|
|
65
64
|
currency: "EUR"
|
|
66
65
|
}
|
|
67
|
-
},
|
|
66
|
+
}, _ = {
|
|
68
67
|
name: "Invalid Amount",
|
|
69
68
|
args: {
|
|
70
69
|
amount: "invalid",
|
|
71
70
|
currency: "EUR"
|
|
72
71
|
}
|
|
73
|
-
},
|
|
72
|
+
}, v = {
|
|
74
73
|
name: "Zero Amount with Display as Zero",
|
|
75
74
|
args: {
|
|
76
75
|
amount: 0,
|
|
77
76
|
zeroDisplayOption: o.DISPLAY_AS_ZERO,
|
|
78
77
|
currency: "EUR"
|
|
79
78
|
}
|
|
80
|
-
},
|
|
79
|
+
}, U = {
|
|
81
80
|
name: "Zero Amount with Display as Zero With Currency",
|
|
82
81
|
args: {
|
|
83
82
|
amount: 0,
|
|
84
83
|
zeroDisplayOption: o.DISPLAY_AS_ZERO_WITH_CURRENCY,
|
|
85
84
|
currency: "EUR"
|
|
86
85
|
}
|
|
87
|
-
},
|
|
86
|
+
}, I = {
|
|
88
87
|
name: "Zero Amount with Display as Zero With Currency No Decimal",
|
|
89
88
|
args: {
|
|
90
89
|
amount: 0,
|
|
91
90
|
zeroDisplayOption: o.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL,
|
|
92
91
|
currency: "EUR"
|
|
93
92
|
}
|
|
94
|
-
},
|
|
93
|
+
}, b = {
|
|
95
94
|
name: "Negative Amount",
|
|
96
95
|
args: {
|
|
97
96
|
amount: -100,
|
|
98
97
|
currency: "EUR"
|
|
99
98
|
}
|
|
100
|
-
},
|
|
99
|
+
}, N = {
|
|
101
100
|
name: "Custom Zero Amount",
|
|
102
101
|
args: {
|
|
103
102
|
amount: 0,
|
|
@@ -107,12 +106,12 @@ const h = {
|
|
|
107
106
|
}
|
|
108
107
|
};
|
|
109
108
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
N as CustomZeroAmount,
|
|
110
|
+
h as Default,
|
|
111
|
+
_ as InvalidAmount,
|
|
112
|
+
b as NegativeAmount,
|
|
113
|
+
v as ZeroAmount,
|
|
114
|
+
U as ZeroCurrencyAmount,
|
|
115
|
+
I as ZeroCurrencyNoDecimalAmount,
|
|
116
|
+
f as default
|
|
118
117
|
};
|
|
@@ -1,258 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { useContext as D, useState as m, useEffect as h, useMemo as G } from "react";
|
|
4
|
-
import "react-i18next";
|
|
5
|
-
import { useQuery as u, useMutation as R } from "@tanstack/react-query";
|
|
1
|
+
import { jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as m } from "@tanstack/react-query";
|
|
6
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
queryKey: [E.LINKED_USER_PROGRAMS, e == null ? void 0 : e.id],
|
|
26
|
-
queryFn: () => e != null && e.id ? A.getLinkedUserAwards(e.id) : [],
|
|
27
|
-
placeholderData: [],
|
|
28
|
-
enabled: !!(e != null && e.id)
|
|
29
|
-
}), { data: _ } = u({
|
|
30
|
-
queryKey: [E.BANKS],
|
|
31
|
-
queryFn: A.getBanks,
|
|
32
|
-
placeholderData: []
|
|
33
|
-
}), { data: s } = u({
|
|
34
|
-
queryKey: [E.CARDS],
|
|
35
|
-
queryFn: A.getCards,
|
|
36
|
-
placeholderData: []
|
|
37
|
-
}), { data: o } = u({
|
|
38
|
-
queryKey: [E.USER_CARDS],
|
|
39
|
-
queryFn: A.getUserCards,
|
|
40
|
-
placeholderData: []
|
|
41
|
-
}), { featureFlags: i, featureFlagsLoaded: l } = L(), { data: d } = u({
|
|
42
|
-
queryKey: [E.POINTS_AS_CASH],
|
|
43
|
-
queryFn: A.getPointsAsCash,
|
|
44
|
-
placeholderData: { availablePoints: 0, valuePerPoint: 0, currency: "" },
|
|
45
|
-
enabled: l && i.usePointsAsCashFeature
|
|
46
|
-
}), { mutate: I } = R({
|
|
47
|
-
mutationFn: async (n) => {
|
|
48
|
-
const { mainProgram: S, awardsAmount: T } = typeof n == "string" ? { mainProgram: n, awardsAmount: 0 } : n;
|
|
49
|
-
await A.addAwardProgram(S, T);
|
|
50
|
-
},
|
|
51
|
-
onSuccess: () => {
|
|
52
|
-
c.invalidateQueries({
|
|
53
|
-
queryKey: [E.LINKED_USER_PROGRAMS]
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}), { mutate: O } = R({
|
|
57
|
-
mutationFn: async (n) => {
|
|
58
|
-
await A.removeAwardProgram(n);
|
|
59
|
-
},
|
|
60
|
-
onSuccess: () => {
|
|
61
|
-
c.invalidateQueries({
|
|
62
|
-
queryKey: [E.LINKED_USER_PROGRAMS]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}), { mutateAsync: N } = R({
|
|
66
|
-
mutationFn: async ({ mainProgram: n, awardsAmount: S }) => {
|
|
67
|
-
const T = r == null ? void 0 : r.find((f) => f.mainProgram === n);
|
|
68
|
-
if (!T)
|
|
69
|
-
throw new Error("Program not found");
|
|
70
|
-
return A.setAwardPoints(T.mainProgram, S);
|
|
71
|
-
},
|
|
72
|
-
onSuccess: () => {
|
|
73
|
-
[
|
|
74
|
-
E.LINKED_USER_PROGRAMS,
|
|
75
|
-
E.USER_PROGRAMS,
|
|
76
|
-
E.PROGRAMS
|
|
77
|
-
].forEach((n) => {
|
|
78
|
-
c.invalidateQueries({ queryKey: [n] });
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}), { mutateAsync: g } = R({
|
|
82
|
-
mutationFn: async (n) => A.addCardsToWallet(n),
|
|
83
|
-
onSuccess: () => {
|
|
84
|
-
c.invalidateQueries({
|
|
85
|
-
queryKey: [E.USER_CARDS]
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}), { mutateAsync: C } = R({
|
|
89
|
-
mutationFn: async (n) => A.removeCardsFromWallet(n),
|
|
90
|
-
onSuccess: () => {
|
|
91
|
-
c.invalidateQueries({
|
|
92
|
-
queryKey: [E.USER_CARDS]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return {
|
|
97
|
-
// Program Management
|
|
98
|
-
allPrograms: r || [],
|
|
99
|
-
userPrograms: t || [],
|
|
100
|
-
linkedUserPrograms: a || [],
|
|
101
|
-
hotelPrograms: (r == null ? void 0 : r.filter(
|
|
102
|
-
(n) => n.category.includes(F.HOTEL)
|
|
103
|
-
)) || [],
|
|
104
|
-
airlinePrograms: (r == null ? void 0 : r.filter(
|
|
105
|
-
(n) => n.category.includes(F.AIRLINE)
|
|
106
|
-
)) || [],
|
|
107
|
-
bankPrograms: (r == null ? void 0 : r.filter(
|
|
108
|
-
(n) => n.category.includes(F.BANK)
|
|
109
|
-
)) || [],
|
|
110
|
-
updatePoints: N,
|
|
111
|
-
addAwardProgram: I,
|
|
112
|
-
removeAwardProgram: O,
|
|
113
|
-
// Card Management
|
|
114
|
-
banks: _ || [],
|
|
115
|
-
allCards: s || [],
|
|
116
|
-
userCards: o || [],
|
|
117
|
-
addCards: g,
|
|
118
|
-
removeCards: C,
|
|
119
|
-
pointsAsCash: d || {
|
|
120
|
-
availablePoints: 0,
|
|
121
|
-
valuePerPoint: 0,
|
|
122
|
-
currency: ""
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
class q {
|
|
127
|
-
static async getFeatures() {
|
|
128
|
-
try {
|
|
129
|
-
const { data: r } = await U.get(P.FEATURES), t = {};
|
|
130
|
-
for (const a of r.data)
|
|
131
|
-
a.type !== "array" ? t[a.name] = a.value : t[a.name] = a.values.join(",");
|
|
132
|
-
return t;
|
|
133
|
-
} catch (r) {
|
|
134
|
-
return console.error("in service error", r), {};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
static async getFeatureFlags() {
|
|
138
|
-
try {
|
|
139
|
-
const { data: r } = await U.get(P.FEATURES), t = {};
|
|
140
|
-
for (const a of r.data)
|
|
141
|
-
a.type !== "array" ? t[a.name] = a.value : t[a.name] = a.values;
|
|
142
|
-
return t;
|
|
143
|
-
} catch (r) {
|
|
144
|
-
return console.error("in service error", r), {};
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
const M = [
|
|
149
|
-
"DEFAULT_CURRENCY_FEATURE",
|
|
150
|
-
"TOTAL_DISPLAY_FEATURE",
|
|
151
|
-
"HOTEL_DETAILS_LAYOUT_FEATURE",
|
|
152
|
-
"TRIP_MANAGEMENT_FEATURE",
|
|
153
|
-
"FLIGHT_FILTER_LAYOUT_FEATURE",
|
|
154
|
-
"WALLET_MANAGEMENT_FEATURE",
|
|
155
|
-
"WALLET_PROGRAM_TYPES_FEATURES",
|
|
156
|
-
"FLIGHT_PAGINATION_FEATURE",
|
|
157
|
-
"AVAILABILITY_ALERTS_DISPLAY_FEATURE",
|
|
158
|
-
"PAYMENT_TYPE_FEATURE",
|
|
159
|
-
"HOTEL_DETAILS_FEATURES",
|
|
160
|
-
"SEARCH_RADIUS_POSITION_FEATURE",
|
|
161
|
-
"NAVIGATION_FEATURE",
|
|
162
|
-
"AMOUNTS_DISPLAY_FEATURE"
|
|
163
|
-
], Y = [
|
|
164
|
-
"CURRENCY_FILTER_FEATURE",
|
|
165
|
-
"FREE_HOTEL_NIGHTS_FEATURE",
|
|
166
|
-
"SHOW_BOOKABLE_FEATURE",
|
|
167
|
-
"FILTER_PRESETS_FEATURE",
|
|
168
|
-
"SPLIT_HOTEL_CHAINS_FEATURE",
|
|
169
|
-
"FLIGHT_SHOW_ANIMATION_FEATURE",
|
|
170
|
-
"SHOW_FOOTER_FEATURE",
|
|
171
|
-
"SHOW_AVAILABILITY_ALERTS_FEATURE",
|
|
172
|
-
"USE_POINTS_AS_CASH_FEATURE",
|
|
173
|
-
"HEADER_NAVIGATION_FEATURE",
|
|
174
|
-
"SHOW_FLIGHTS_TRANSFER_PARTNER_FEATURE",
|
|
175
|
-
"HOTEL_POINTS_ONLY_FEATURE",
|
|
176
|
-
"FREE_HOTEL_NIGHTS_FEATURE",
|
|
177
|
-
"HOTEL_DISPLAY_BEST_VALUE_FEATURE",
|
|
178
|
-
"HOTEL_DISPLAY_POINTS_BREAKDOWN_FEATURE",
|
|
179
|
-
"USE_TAB_NAVIGATION",
|
|
180
|
-
"TAB_NAVIGATION_FEATURE",
|
|
181
|
-
"ADD_AIRLINE_HEALTH_PAGE_FEATURE",
|
|
182
|
-
"SHOW_NAVIGATION_POPUP_FEATURE",
|
|
183
|
-
"SHOW_ONLY_BOOKABLE_FEATURE"
|
|
184
|
-
], B = [
|
|
185
|
-
"HOTEL_DETAILS_FEATURE",
|
|
186
|
-
"WALLET_PROGRAM_TYPES_FEATURES",
|
|
187
|
-
"HOTEL_FILTERS_FEATURES",
|
|
188
|
-
"FLIGHT_FILTERS_FEATURES",
|
|
189
|
-
"WALLET_FEATURES"
|
|
190
|
-
], W = () => {
|
|
191
|
-
const [e, r] = m({}), [t, a] = m(!1), _ = async () => {
|
|
192
|
-
try {
|
|
193
|
-
const s = await q.getFeatureFlags();
|
|
194
|
-
r(s);
|
|
195
|
-
} catch (s) {
|
|
196
|
-
console.error("Error fetching feature flags:", s);
|
|
197
|
-
} finally {
|
|
198
|
-
a(!0);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
return h(() => {
|
|
202
|
-
_();
|
|
203
|
-
}, []), {
|
|
204
|
-
featureFlags: (t && e ? (() => {
|
|
205
|
-
const s = {};
|
|
206
|
-
return M.forEach((o) => {
|
|
207
|
-
const i = y(
|
|
208
|
-
o.toLowerCase()
|
|
209
|
-
);
|
|
210
|
-
e[o] !== void 0 && (s[i] = e[o]);
|
|
211
|
-
}), Y.forEach((o) => {
|
|
212
|
-
const i = y(
|
|
213
|
-
o.toLowerCase()
|
|
214
|
-
);
|
|
215
|
-
e[o] !== void 0 && (s[i] = e[o]);
|
|
216
|
-
}), B.forEach((o) => {
|
|
217
|
-
const i = y(
|
|
218
|
-
o.toLowerCase()
|
|
219
|
-
);
|
|
220
|
-
e[o] !== void 0 && (s[i] = e[o]);
|
|
221
|
-
}), s;
|
|
222
|
-
})() : void 0) ?? {},
|
|
223
|
-
loaded: t
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
function V(e) {
|
|
227
|
-
if (!e || isNaN(e) || e < 0) return "N/A";
|
|
228
|
-
let r = e == null ? void 0 : e.toString().split(".")[0];
|
|
229
|
-
return r == null ? void 0 : r.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
4
|
+
import { E as u } from "../../noRetryInstance-oiHCni_Z.js";
|
|
5
|
+
import { useMemo as f } from "react";
|
|
6
|
+
import { useAwayzContext as y } from "../../hooks/useAwayzContext.js";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import '../../assets/_styles3.css';import '../../assets/_styles4.css';import '../../assets/_styles.css';import '../../assets/_styles2.css';/* empty css */
|
|
9
|
+
import "../../_styles.flight-booking-DEUJthTJ.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
import { CurrencyService as l } from "../../services/currency/CurrencyService.js";
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
import "../../configs/awayzClient.js";
|
|
15
|
+
import "../../context/AwayzContext.js";
|
|
16
|
+
import { useFeatureFlags as C } from "../../hooks/useFeatureFlags.js";
|
|
17
|
+
import { useWallet as d } from "../../hooks/useWallet/useWallet.js";
|
|
18
|
+
function g(t) {
|
|
19
|
+
if (!t || isNaN(t) || t < 0) return "N/A";
|
|
20
|
+
let e = t == null ? void 0 : t.toString().split(".")[0];
|
|
21
|
+
return e == null ? void 0 : e.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
230
22
|
}
|
|
231
|
-
const
|
|
232
|
-
var
|
|
233
|
-
return ((
|
|
234
|
-
},
|
|
235
|
-
cashAmount:
|
|
236
|
-
currency:
|
|
23
|
+
const v = (t, e) => {
|
|
24
|
+
var o;
|
|
25
|
+
return ((o = e == null ? void 0 : e.preferences) == null ? void 0 : o.currency) ?? (e == null ? void 0 : e.userRegion.currency) ?? t;
|
|
26
|
+
}, O = ({
|
|
27
|
+
cashAmount: t,
|
|
28
|
+
currency: e
|
|
237
29
|
}) => {
|
|
238
|
-
const { pointsAsCash:
|
|
239
|
-
() =>
|
|
240
|
-
[
|
|
241
|
-
), { data:
|
|
242
|
-
queryKey: [
|
|
243
|
-
queryFn: () =>
|
|
244
|
-
baseCurrency:
|
|
245
|
-
targetCurrency:
|
|
30
|
+
const { pointsAsCash: r } = d(), { user: o } = y(), { featureFlags: i } = C(), n = f(
|
|
31
|
+
() => v(i.defaultCurrencyFeature, o),
|
|
32
|
+
[o]
|
|
33
|
+
), { data: c } = m({
|
|
34
|
+
queryKey: [u.CONVERT_CURRENCY, e, r.currency],
|
|
35
|
+
queryFn: () => l.convertCurrency({
|
|
36
|
+
baseCurrency: e,
|
|
37
|
+
targetCurrency: r.currency
|
|
246
38
|
}),
|
|
247
39
|
staleTime: 1e3 * 60 * 60,
|
|
248
40
|
// 1 hour
|
|
249
|
-
enabled: !!
|
|
250
|
-
}),
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
|
|
41
|
+
enabled: !!e && !!n && e !== n && r.currency !== e && !!r.currency
|
|
42
|
+
}), s = t * (c ?? 1), a = Math.floor(s / r.valuePerPoint);
|
|
43
|
+
return /* @__PURE__ */ p("p", { className: "client-points-amount", children: [
|
|
44
|
+
g(a),
|
|
253
45
|
" pts."
|
|
254
46
|
] });
|
|
255
47
|
};
|
|
256
48
|
export {
|
|
257
|
-
|
|
49
|
+
O as ClientPointsValue
|
|
258
50
|
};
|
|
@@ -4,7 +4,7 @@ import Y from "react";
|
|
|
4
4
|
import { c as ce, a as ue, u as D, b as bn, d as y, e as X, f as Cn, g as yn, o as En, s as Mn, h as wn, i as Rn, j as Sn, k as Pn, l as _n, m as In, n as Se, p as Q, q as Ne, P as Ce, r as xn, R as An, F as On } from "../../Combination-CrPZjD5u.js";
|
|
5
5
|
import { r as Nn, R as Tn } from "../../index-Cv-wvFlM.js";
|
|
6
6
|
import '../../assets/_styles2.css';/* empty css */
|
|
7
|
-
import { d as Dn, e as Fn } from "../../index-
|
|
7
|
+
import { d as Dn, e as Fn } from "../../index-C8p5kinH.js";
|
|
8
8
|
// @__NO_SIDE_EFFECTS__
|
|
9
9
|
function Ze(e) {
|
|
10
10
|
const t = /* @__PURE__ */ Ln(e), n = a.forwardRef((r, o) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import '../../../assets/_styles3.css';/* empty css */
|
|
3
|
-
import { b as l } from "../../../index-
|
|
3
|
+
import { b as l } from "../../../index-C8p5kinH.js";
|
|
4
4
|
import "../../../arrayExtensions-DlcBOj5a.js";
|
|
5
5
|
import "react";
|
|
6
6
|
const t = (r) => {
|
|
@@ -7,23 +7,22 @@ import "../../../_styles.flight-booking-DEUJthTJ.js";
|
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../configs/awayzClient.js";
|
|
10
|
-
import "../../../noRetryInstance-
|
|
10
|
+
import "../../../noRetryInstance-oiHCni_Z.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import "../../../RewardsService-CB88je4D.js";
|
|
13
|
-
import { Card as r } from "./Card.js";
|
|
14
12
|
import "../../../context/AwayzContext.js";
|
|
15
|
-
import {
|
|
13
|
+
import { Card as a } from "./Card.js";
|
|
14
|
+
import { AwayzProvider as r } from "../../../providers/AwayzProvider.js";
|
|
16
15
|
import { EAuthFlow as e } from "../../../types/EAuthFlow.js";
|
|
17
|
-
const
|
|
16
|
+
const y = {
|
|
18
17
|
title: "Wallet/Card",
|
|
19
|
-
component:
|
|
18
|
+
component: a,
|
|
20
19
|
parameters: {
|
|
21
20
|
layout: "centered"
|
|
22
21
|
},
|
|
23
22
|
tags: ["autodocs"],
|
|
24
23
|
decorators: [
|
|
25
24
|
(o) => /* @__PURE__ */ t(
|
|
26
|
-
|
|
25
|
+
r,
|
|
27
26
|
{
|
|
28
27
|
config: {
|
|
29
28
|
testMode: !0,
|
|
@@ -36,7 +35,7 @@ const v = {
|
|
|
36
35
|
}
|
|
37
36
|
)
|
|
38
37
|
]
|
|
39
|
-
},
|
|
38
|
+
}, v = {
|
|
40
39
|
args: {
|
|
41
40
|
details: {
|
|
42
41
|
id: "12345",
|
|
@@ -48,7 +47,7 @@ const v = {
|
|
|
48
47
|
console.log("Card deleted:", o);
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
},
|
|
50
|
+
}, z = {
|
|
52
51
|
args: {
|
|
53
52
|
details: {
|
|
54
53
|
name: "IHG Rewards Club Premier",
|
|
@@ -58,7 +57,7 @@ const v = {
|
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
59
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
v as DarkCard,
|
|
61
|
+
z as LightCard,
|
|
62
|
+
y as default
|
|
64
63
|
};
|