@odynn/awayz-hotels 0.1.11 → 0.1.13
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/components/Banners/Ratings/Ratings.js +1 -1
- package/dist/components/Banners/UnavailableDate/UnavailableDate.js +1 -1
- package/dist/components/HotelResult/HotelResult.js +1 -1
- package/dist/hooks/useHotelDetails/useHotelDetails.js +51 -52
- package/dist/hooks/useHotelSearch/useHotelSearch.js +53 -157
- package/dist/hooks/useLocationSearch/useLocationSearch.js +3 -3
- package/dist/{index-DGPMPU5O.js → index-B2vRnlU4.js} +4 -4
- package/dist/lib/hooks/useHotelDetails/useHotelDetails.d.ts +5 -2
- package/dist/objectUtils-CyIaVmog.js +10 -0
- package/dist/services/booking/BookingService.js +18 -19
- package/dist/services/hotel/HotelService.js +22 -23
- package/dist/services/wallet/WalletService.js +4 -5
- package/dist/stores/useHotelsStore.js +4 -4
- package/dist/utilities/pointsAsCashUtils.js +6 -8
- package/package.json +1 -1
- package/dist/awayzClient-Bs2isDLP.js +0 -6136
- package/dist/useQuery-CnSaNIvY.js +0 -398
- package/dist/utils-DpMVuKj_.js +0 -20
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { a as d, b as i } from "../../../index-
|
|
2
|
+
import { a as d, b as i } from "../../../index-B2vRnlU4.js";
|
|
3
3
|
import '../../../assets/Ratings.css';var p = /* @__PURE__ */ ((r) => (r.INHERIT = "inherit", r.PRIMARY = "primary", r.LIGHT = "light", r.DARK = "dark", r))(p || {});
|
|
4
4
|
const f = ({
|
|
5
5
|
starRating: r,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as e, Fragment as r, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { HotelChains as l } from "../../../definitions/HotelChains.js";
|
|
3
|
-
import { F as t } from "../../../index-
|
|
3
|
+
import { F as t } from "../../../index-B2vRnlU4.js";
|
|
4
4
|
import '../../../assets/UnavailableDate.css';const h = ({
|
|
5
5
|
hasPoints: o,
|
|
6
6
|
isAvailable: n,
|
|
@@ -5,7 +5,7 @@ import { o as I } from "../../stringUtils-CvWpky85.js";
|
|
|
5
5
|
import "../../moment-BGjjqtLQ.js";
|
|
6
6
|
import "../../arrayExtensions-cyilNkdJ.js";
|
|
7
7
|
import { UnavailableDate as x } from "../Banners/UnavailableDate/UnavailableDate.js";
|
|
8
|
-
import { c as C, d as H, e as V, f as b } from "../../index-
|
|
8
|
+
import { c as C, d as H, e as V, f as b } from "../../index-B2vRnlU4.js";
|
|
9
9
|
import { HotelChains as f } from "../../definitions/HotelChains.js";
|
|
10
10
|
import j, { ERatingColor as w } from "../Banners/Ratings/Ratings.js";
|
|
11
11
|
import { getBookingOptions as B } from "../../utilities/hotelUtils/hotelUtils.js";
|
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { h as
|
|
1
|
+
import { useMemo as S } from "react";
|
|
2
|
+
import { h as g } from "../../moment-BGjjqtLQ.js";
|
|
3
3
|
import "../../arrayExtensions-cyilNkdJ.js";
|
|
4
|
-
import
|
|
5
|
-
import { fetchTransferPartners as
|
|
4
|
+
import N from "../../stores/useHotelsStore.js";
|
|
5
|
+
import { fetchTransferPartners as M, fetchPointsCheck as T, fetchAvailableRooms as x, fetchBestCheckout as E, combineUpdatedHotelData as m, fallbackBestCheckout as Q } from "./useHotelDetails.api.js";
|
|
6
6
|
import { calculatePointsAsCash as U } from "../../utilities/pointsAsCashUtils.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useQuery as o } from "@tanstack/react-query";
|
|
8
8
|
const j = (t, a) => Math.abs(
|
|
9
|
-
|
|
9
|
+
g(t.startOf("day")).diff(g(a.endOf("day")), "days")
|
|
10
10
|
), _ = (t) => {
|
|
11
|
-
var
|
|
11
|
+
var d, h, k, f, D, p, y, C, b, v;
|
|
12
12
|
if (!t)
|
|
13
13
|
throw new Error(
|
|
14
14
|
"Hotel is required in order to initiate the hotel details flow"
|
|
15
15
|
);
|
|
16
|
-
const { updateHotel: a, searchParams: e } =
|
|
16
|
+
const { updateHotel: a, searchParams: e } = N(), s = S(() => e ? j(
|
|
17
17
|
e.checkinDate,
|
|
18
18
|
e.checkoutDate
|
|
19
|
-
) : 0, [e]), {
|
|
20
|
-
data: C,
|
|
21
|
-
isLoading: b,
|
|
22
|
-
isError: v
|
|
23
|
-
} = o({
|
|
19
|
+
) : 0, [e]), { data: O, isLoading: q } = o({
|
|
24
20
|
queryKey: ["transferPartners", t.hotelGroup],
|
|
25
|
-
queryFn: () =>
|
|
21
|
+
queryFn: () => M(t.hotelGroup),
|
|
26
22
|
enabled: !!t.hotelGroup,
|
|
27
23
|
placeholderData: []
|
|
28
24
|
}), {
|
|
29
|
-
data:
|
|
30
|
-
isLoading:
|
|
31
|
-
isPlaceholderData:
|
|
25
|
+
data: H,
|
|
26
|
+
isLoading: i,
|
|
27
|
+
isPlaceholderData: R
|
|
32
28
|
} = o({
|
|
33
29
|
queryKey: [
|
|
34
30
|
"hotelPointsCheck",
|
|
35
31
|
t.hotelId,
|
|
36
32
|
t.hotelGroup,
|
|
37
|
-
(
|
|
38
|
-
(
|
|
33
|
+
(d = e == null ? void 0 : e.checkinDate) == null ? void 0 : d.valueOf(),
|
|
34
|
+
(h = e == null ? void 0 : e.checkoutDate) == null ? void 0 : h.valueOf()
|
|
39
35
|
],
|
|
40
|
-
queryFn: () =>
|
|
36
|
+
queryFn: () => T({
|
|
41
37
|
hotel: t,
|
|
42
38
|
checkinDate: e.checkinDate,
|
|
43
39
|
checkoutDate: e.checkoutDate,
|
|
@@ -51,24 +47,24 @@ const j = (t, a) => Math.abs(
|
|
|
51
47
|
pointsRooms: t.rooms ?? [],
|
|
52
48
|
shouldFallbackBestCheckout: !1
|
|
53
49
|
}
|
|
54
|
-
}), { pointsRooms:
|
|
50
|
+
}), { pointsRooms: B, pointsHotelDetails: l, shouldFallbackBestCheckout: A } = H || {
|
|
55
51
|
pointsHotelDetails: t,
|
|
56
52
|
pointsRooms: [],
|
|
57
53
|
shouldFallbackBestCheckout: !1
|
|
58
54
|
}, {
|
|
59
|
-
data:
|
|
60
|
-
isLoading:
|
|
61
|
-
isPlaceholderData:
|
|
55
|
+
data: F,
|
|
56
|
+
isLoading: n,
|
|
57
|
+
isPlaceholderData: G
|
|
62
58
|
} = o({
|
|
63
59
|
queryKey: [
|
|
64
60
|
"fetchAvailableRooms",
|
|
65
|
-
(
|
|
66
|
-
(
|
|
67
|
-
(
|
|
61
|
+
(k = t.cashBookingOffers) == null ? void 0 : k.accommodationId,
|
|
62
|
+
(f = e == null ? void 0 : e.checkinDate) == null ? void 0 : f.valueOf(),
|
|
63
|
+
(D = e == null ? void 0 : e.checkoutDate) == null ? void 0 : D.valueOf(),
|
|
68
64
|
e == null ? void 0 : e.guests,
|
|
69
65
|
e == null ? void 0 : e.rooms
|
|
70
66
|
],
|
|
71
|
-
queryFn: () =>
|
|
67
|
+
queryFn: () => x({
|
|
72
68
|
hotel: t,
|
|
73
69
|
checkinDate: e.checkinDate,
|
|
74
70
|
checkoutDate: e.checkoutDate,
|
|
@@ -77,65 +73,68 @@ const j = (t, a) => Math.abs(
|
|
|
77
73
|
updateHotel: a,
|
|
78
74
|
numberOfNights: s
|
|
79
75
|
}),
|
|
80
|
-
enabled: !!e && !!e.checkinDate && !!e.checkoutDate && !!((
|
|
76
|
+
enabled: !!e && !!e.checkinDate && !!e.checkoutDate && !!((p = t.cashBookingOffers) != null && p.accommodationId),
|
|
81
77
|
retry: !1,
|
|
82
78
|
placeholderData: {
|
|
83
79
|
cashHotelDetails: t,
|
|
84
80
|
cashRooms: []
|
|
85
81
|
}
|
|
86
|
-
}), { cashRooms:
|
|
82
|
+
}), { cashRooms: L, cashHotelDetails: u } = F || {
|
|
87
83
|
cashHotelDetails: t,
|
|
88
84
|
cashRooms: []
|
|
89
|
-
}, { data: I } = o({
|
|
85
|
+
}, { data: I, isLoading: K } = o({
|
|
90
86
|
queryKey: [
|
|
91
87
|
"bestCheckout",
|
|
92
88
|
t.hotelId,
|
|
93
89
|
t.hotelGroup,
|
|
94
|
-
(
|
|
95
|
-
(
|
|
90
|
+
(y = e == null ? void 0 : e.checkinDate) == null ? void 0 : y.valueOf(),
|
|
91
|
+
(C = e == null ? void 0 : e.checkoutDate) == null ? void 0 : C.valueOf()
|
|
96
92
|
],
|
|
97
|
-
queryFn: () =>
|
|
98
|
-
|
|
93
|
+
queryFn: () => E(
|
|
94
|
+
m(t, l, u),
|
|
99
95
|
s
|
|
100
96
|
),
|
|
101
|
-
enabled: !
|
|
97
|
+
enabled: !i && (t.liveScrapingCheckNeeded ? !R : !0) && !n && !G && !A && s > 0,
|
|
102
98
|
retry: !1,
|
|
103
99
|
placeholderData: {
|
|
104
100
|
bestCheckout: Q(t, s),
|
|
105
101
|
isAvailable: !1
|
|
106
102
|
}
|
|
107
|
-
}), { bestCheckout: c, isAvailable:
|
|
103
|
+
}), { bestCheckout: c, isAvailable: r } = I || {
|
|
108
104
|
isAvailable: !1
|
|
109
|
-
}, { data:
|
|
105
|
+
}, { data: w } = o({
|
|
110
106
|
queryKey: [
|
|
111
107
|
"pointsAsCash",
|
|
112
108
|
t.hotelId,
|
|
113
109
|
t.hotelGroup,
|
|
114
|
-
(
|
|
115
|
-
(
|
|
110
|
+
(b = e == null ? void 0 : e.checkinDate) == null ? void 0 : b.valueOf(),
|
|
111
|
+
(v = e == null ? void 0 : e.checkoutDate) == null ? void 0 : v.valueOf()
|
|
116
112
|
],
|
|
117
113
|
queryFn: () => U(c.totalCashCost),
|
|
118
|
-
enabled: !!c &&
|
|
114
|
+
enabled: !!c && r,
|
|
119
115
|
retry: !1
|
|
120
116
|
});
|
|
121
117
|
return {
|
|
122
|
-
transferPartners:
|
|
123
|
-
|
|
124
|
-
isLoadingTransferPartners: b,
|
|
125
|
-
isTransferPartnersError: v,
|
|
118
|
+
transferPartners: O,
|
|
119
|
+
loadingTransferPartners: q,
|
|
126
120
|
// Points Check
|
|
127
|
-
pointsRooms:
|
|
128
|
-
|
|
121
|
+
pointsRooms: B,
|
|
122
|
+
loadingLivePointsCheck: i,
|
|
129
123
|
// Cash Rooms
|
|
130
|
-
cashRooms:
|
|
131
|
-
|
|
124
|
+
cashRooms: L,
|
|
125
|
+
loadingCashRooms: n,
|
|
132
126
|
// Best Checkout
|
|
133
127
|
bestCheckout: c,
|
|
134
|
-
|
|
128
|
+
loadingBestCheckout: K,
|
|
135
129
|
// Combined availability
|
|
136
|
-
isAvailable:
|
|
130
|
+
isAvailable: r,
|
|
137
131
|
// Points as Cash
|
|
138
|
-
pointsAsCash:
|
|
132
|
+
pointsAsCash: w,
|
|
133
|
+
hotelDetails: m(
|
|
134
|
+
t,
|
|
135
|
+
l,
|
|
136
|
+
u
|
|
137
|
+
)
|
|
139
138
|
};
|
|
140
139
|
};
|
|
141
140
|
export {
|
|
@@ -1,152 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { HotelService as q } from "../../services/hotel/HotelService.js";
|
|
10
|
-
import { ESearchType as $ } from "../../services/hotel/HotelService.types.js";
|
|
11
|
-
import { HotelChains as w } from "../../definitions/HotelChains.js";
|
|
12
|
-
import { h as C } from "../../moment-BGjjqtLQ.js";
|
|
13
|
-
import j from "../../stores/useHotelsStore.js";
|
|
14
|
-
var d, p, h, u, c, v, I, L, A = (L = class extends x {
|
|
15
|
-
constructor(t, o) {
|
|
16
|
-
super();
|
|
17
|
-
y(this, c);
|
|
18
|
-
y(this, d);
|
|
19
|
-
y(this, p);
|
|
20
|
-
y(this, h);
|
|
21
|
-
y(this, u);
|
|
22
|
-
S(this, d, t), this.setOptions(o), this.bindMethods(), b(this, c, v).call(this);
|
|
23
|
-
}
|
|
24
|
-
bindMethods() {
|
|
25
|
-
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
26
|
-
}
|
|
27
|
-
setOptions(t) {
|
|
28
|
-
var r;
|
|
29
|
-
const o = this.options;
|
|
30
|
-
this.options = i(this, d).defaultMutationOptions(t), B(this.options, o) || i(this, d).getMutationCache().notify({
|
|
31
|
-
type: "observerOptionsUpdated",
|
|
32
|
-
mutation: i(this, h),
|
|
33
|
-
observer: this
|
|
34
|
-
}), o != null && o.mutationKey && this.options.mutationKey && M(o.mutationKey) !== M(this.options.mutationKey) ? this.reset() : ((r = i(this, h)) == null ? void 0 : r.state.status) === "pending" && i(this, h).setOptions(this.options);
|
|
35
|
-
}
|
|
36
|
-
onUnsubscribe() {
|
|
37
|
-
var t;
|
|
38
|
-
this.hasListeners() || (t = i(this, h)) == null || t.removeObserver(this);
|
|
39
|
-
}
|
|
40
|
-
onMutationUpdate(t) {
|
|
41
|
-
b(this, c, v).call(this), b(this, c, I).call(this, t);
|
|
42
|
-
}
|
|
43
|
-
getCurrentResult() {
|
|
44
|
-
return i(this, p);
|
|
45
|
-
}
|
|
46
|
-
reset() {
|
|
47
|
-
var t;
|
|
48
|
-
(t = i(this, h)) == null || t.removeObserver(this), S(this, h, void 0), b(this, c, v).call(this), b(this, c, I).call(this);
|
|
49
|
-
}
|
|
50
|
-
mutate(t, o) {
|
|
51
|
-
var r;
|
|
52
|
-
return S(this, u, o), (r = i(this, h)) == null || r.removeObserver(this), S(this, h, i(this, d).getMutationCache().build(i(this, d), this.options)), i(this, h).addObserver(this), i(this, h).execute(t);
|
|
53
|
-
}
|
|
54
|
-
}, d = new WeakMap(), p = new WeakMap(), h = new WeakMap(), u = new WeakMap(), c = new WeakSet(), v = function() {
|
|
55
|
-
var o;
|
|
56
|
-
const t = ((o = i(this, h)) == null ? void 0 : o.state) ?? P();
|
|
57
|
-
S(this, p, {
|
|
58
|
-
...t,
|
|
59
|
-
isPending: t.status === "pending",
|
|
60
|
-
isSuccess: t.status === "success",
|
|
61
|
-
isError: t.status === "error",
|
|
62
|
-
isIdle: t.status === "idle",
|
|
63
|
-
mutate: this.mutate,
|
|
64
|
-
reset: this.reset
|
|
65
|
-
});
|
|
66
|
-
}, I = function(t) {
|
|
67
|
-
R.batch(() => {
|
|
68
|
-
var o, r, n, m, a, f, E, D;
|
|
69
|
-
if (i(this, u) && this.hasListeners()) {
|
|
70
|
-
const l = i(this, p).variables, e = i(this, p).context;
|
|
71
|
-
(t == null ? void 0 : t.type) === "success" ? ((r = (o = i(this, u)).onSuccess) == null || r.call(o, t.data, l, e), (m = (n = i(this, u)).onSettled) == null || m.call(n, t.data, null, l, e)) : (t == null ? void 0 : t.type) === "error" && ((f = (a = i(this, u)).onError) == null || f.call(a, t.error, l, e), (D = (E = i(this, u)).onSettled) == null || D.call(
|
|
72
|
-
E,
|
|
73
|
-
void 0,
|
|
74
|
-
t.error,
|
|
75
|
-
l,
|
|
76
|
-
e
|
|
77
|
-
));
|
|
78
|
-
}
|
|
79
|
-
this.listeners.forEach((l) => {
|
|
80
|
-
l(i(this, p));
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}, L);
|
|
84
|
-
function G(s, t) {
|
|
85
|
-
const o = K(), [r] = k.useState(
|
|
86
|
-
() => new A(
|
|
87
|
-
o,
|
|
88
|
-
s
|
|
89
|
-
)
|
|
90
|
-
);
|
|
91
|
-
k.useEffect(() => {
|
|
92
|
-
r.setOptions(s);
|
|
93
|
-
}, [r, s]);
|
|
94
|
-
const n = k.useSyncExternalStore(
|
|
95
|
-
k.useCallback(
|
|
96
|
-
(a) => r.subscribe(R.batchCalls(a)),
|
|
97
|
-
[r]
|
|
98
|
-
),
|
|
99
|
-
() => r.getCurrentResult(),
|
|
100
|
-
() => r.getCurrentResult()
|
|
101
|
-
), m = k.useCallback(
|
|
102
|
-
(a, f) => {
|
|
103
|
-
r.mutate(a, f).catch(T);
|
|
104
|
-
},
|
|
105
|
-
[r]
|
|
106
|
-
);
|
|
107
|
-
if (n.error && U(r.options.throwOnError, [n.error]))
|
|
108
|
-
throw n.error;
|
|
109
|
-
return { ...n, mutate: m, mutateAsync: n.mutate };
|
|
110
|
-
}
|
|
111
|
-
const F = (s) => {
|
|
112
|
-
if (!s.checkinDate || !s.checkoutDate)
|
|
1
|
+
import { useMutation as i } from "@tanstack/react-query";
|
|
2
|
+
import { HotelService as n } from "../../services/hotel/HotelService.js";
|
|
3
|
+
import { ESearchType as D } from "../../services/hotel/HotelService.types.js";
|
|
4
|
+
import { HotelChains as t } from "../../definitions/HotelChains.js";
|
|
5
|
+
import { h as c } from "../../moment-BGjjqtLQ.js";
|
|
6
|
+
import S from "../../stores/useHotelsStore.js";
|
|
7
|
+
const w = (o) => {
|
|
8
|
+
if (!o.checkinDate || !o.checkoutDate)
|
|
113
9
|
throw new Error("Checkin and checkout dates are required");
|
|
114
|
-
if (!
|
|
10
|
+
if (!o.coordinates)
|
|
115
11
|
throw new Error("Coordinates are required");
|
|
116
|
-
|
|
117
|
-
if (!
|
|
12
|
+
o.hotelGroups && o.hotelGroups.forEach((r) => {
|
|
13
|
+
if (!t.toList().includes(r))
|
|
118
14
|
throw new Error(
|
|
119
|
-
`Invalid hotel group: ${
|
|
15
|
+
`Invalid hotel group: ${r}. Please use one of the following: ${t.toList().join(
|
|
120
16
|
", "
|
|
121
17
|
)}`
|
|
122
18
|
);
|
|
123
19
|
});
|
|
124
|
-
},
|
|
125
|
-
if (!
|
|
20
|
+
}, y = (o) => {
|
|
21
|
+
if (!o.checkinDate || !o.checkoutDate)
|
|
126
22
|
throw new Error("Checkin and checkout dates are required");
|
|
127
|
-
if (!
|
|
23
|
+
if (!o.hotelId)
|
|
128
24
|
throw new Error("Hotel ID is required");
|
|
129
|
-
if (!
|
|
25
|
+
if (!o.hotelGroup)
|
|
130
26
|
throw new Error("Hotel group is required");
|
|
131
|
-
if (!
|
|
27
|
+
if (!t.toList().includes(o.hotelGroup))
|
|
132
28
|
throw new Error(
|
|
133
|
-
`Invalid hotel group: ${
|
|
29
|
+
`Invalid hotel group: ${o.hotelGroup}. Please use one of the following: ${t.toList().join(", ")}`
|
|
134
30
|
);
|
|
135
|
-
},
|
|
136
|
-
const { setHotels:
|
|
137
|
-
mutate:
|
|
138
|
-
status:
|
|
139
|
-
isError:
|
|
140
|
-
error:
|
|
141
|
-
} =
|
|
31
|
+
}, G = () => {
|
|
32
|
+
const { setHotels: o, hotels: r, setSearchParams: h } = S(), {
|
|
33
|
+
mutate: u,
|
|
34
|
+
status: a,
|
|
35
|
+
isError: l,
|
|
36
|
+
error: d
|
|
37
|
+
} = i({
|
|
142
38
|
mutationFn: async (e) => {
|
|
143
|
-
|
|
144
|
-
checkinDate:
|
|
145
|
-
checkoutDate:
|
|
39
|
+
w(e), h({
|
|
40
|
+
checkinDate: c(e.checkinDate),
|
|
41
|
+
checkoutDate: c(e.checkoutDate),
|
|
146
42
|
guests: e.guests || 2,
|
|
147
43
|
rooms: e.rooms || 1
|
|
148
44
|
});
|
|
149
|
-
const
|
|
45
|
+
const s = {
|
|
150
46
|
check_in_date: e.checkinDate,
|
|
151
47
|
check_out_date: e.checkoutDate,
|
|
152
48
|
guests: e.guests || 2,
|
|
@@ -157,28 +53,28 @@ const F = (s) => {
|
|
|
157
53
|
lon: e.coordinates.longitude,
|
|
158
54
|
search_range: e.searchRange || 10,
|
|
159
55
|
range_type: e.rangeType || "mi",
|
|
160
|
-
hotel_groups: e.hotelGroups ||
|
|
161
|
-
type: e.searchType ||
|
|
56
|
+
hotel_groups: e.hotelGroups || t.toList(),
|
|
57
|
+
type: e.searchType || D.CITY
|
|
162
58
|
};
|
|
163
|
-
return await
|
|
59
|
+
return await n.searchByCoords(s);
|
|
164
60
|
},
|
|
165
61
|
onSuccess: (e) => {
|
|
166
|
-
e.success &&
|
|
62
|
+
e.success && o(e.data);
|
|
167
63
|
}
|
|
168
64
|
}), {
|
|
169
|
-
mutate:
|
|
170
|
-
status:
|
|
171
|
-
isError:
|
|
172
|
-
error:
|
|
173
|
-
} =
|
|
65
|
+
mutate: p,
|
|
66
|
+
status: m,
|
|
67
|
+
isError: k,
|
|
68
|
+
error: f
|
|
69
|
+
} = i({
|
|
174
70
|
mutationFn: async (e) => {
|
|
175
|
-
|
|
176
|
-
checkinDate:
|
|
177
|
-
checkoutDate:
|
|
71
|
+
y(e), h({
|
|
72
|
+
checkinDate: c(e.checkinDate),
|
|
73
|
+
checkoutDate: c(e.checkoutDate),
|
|
178
74
|
guests: e.guests || 2,
|
|
179
75
|
rooms: e.rooms || 1
|
|
180
76
|
});
|
|
181
|
-
const
|
|
77
|
+
const s = {
|
|
182
78
|
check_in_date: e.checkinDate,
|
|
183
79
|
check_out_date: e.checkoutDate,
|
|
184
80
|
hotel_id: e.hotelId,
|
|
@@ -188,23 +84,23 @@ const F = (s) => {
|
|
|
188
84
|
cash_or_points: e.cashOrPoints || ["cash", "points"],
|
|
189
85
|
hotel_group: e.hotelGroup
|
|
190
86
|
};
|
|
191
|
-
return await
|
|
87
|
+
return await n.searchByHotelId(s);
|
|
192
88
|
},
|
|
193
89
|
onSuccess: (e) => {
|
|
194
|
-
e.success &&
|
|
90
|
+
e.success && o(e.data);
|
|
195
91
|
}
|
|
196
92
|
});
|
|
197
93
|
return {
|
|
198
|
-
results:
|
|
199
|
-
loading:
|
|
200
|
-
isCoordsSearchError:
|
|
201
|
-
coordsSearchError:
|
|
202
|
-
isHotelIdSearchError:
|
|
203
|
-
hotelIdSearchError:
|
|
204
|
-
searchByCoords:
|
|
205
|
-
searchByHotelId:
|
|
94
|
+
results: r,
|
|
95
|
+
loading: a === "pending" || m === "pending",
|
|
96
|
+
isCoordsSearchError: l,
|
|
97
|
+
coordsSearchError: d,
|
|
98
|
+
isHotelIdSearchError: k,
|
|
99
|
+
hotelIdSearchError: f,
|
|
100
|
+
searchByCoords: u,
|
|
101
|
+
searchByHotelId: p
|
|
206
102
|
};
|
|
207
103
|
};
|
|
208
104
|
export {
|
|
209
|
-
|
|
105
|
+
G as useHotelSearch
|
|
210
106
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
2
2
|
import { HotelService as t } from "../../services/hotel/HotelService.js";
|
|
3
|
-
const
|
|
3
|
+
const c = (o) => {
|
|
4
4
|
const { data: e, isLoading: i } = r({
|
|
5
5
|
queryKey: ["locations", o],
|
|
6
6
|
queryFn: () => t.getLocations(o),
|
|
@@ -13,5 +13,5 @@ const s = (o) => {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
c as useLocationSearch
|
|
17
17
|
};
|
|
@@ -122,16 +122,16 @@ function E(t) {
|
|
|
122
122
|
function M(t) {
|
|
123
123
|
return i({ tag: "svg", attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M560 64c8.84 0 16-7.16 16-16V16c0-8.84-7.16-16-16-16H16C7.16 0 0 7.16 0 16v32c0 8.84 7.16 16 16 16h15.98v384H16c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h240v-80c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v80h240c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16h-16V64h16zm-304 44.8c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zm0 96c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zm-128-96c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zM179.2 256h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8zM192 384c0-53.02 42.98-96 96-96s96 42.98 96 96H192zm256-140.8c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm0-96c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4z" }, child: [] }] })(t);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function B(t) {
|
|
126
126
|
return i({ tag: "svg", attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" }, child: [] }] })(t);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function H(t) {
|
|
129
129
|
return i({ tag: "svg", attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z" }, child: [] }] })(t);
|
|
130
130
|
}
|
|
131
131
|
export {
|
|
132
132
|
E as F,
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
B as a,
|
|
134
|
+
H as b,
|
|
135
135
|
M as c,
|
|
136
136
|
C as d,
|
|
137
137
|
L as e,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { IHotelDetails } from '../../components/HotelResult/HotelResult.types';
|
|
2
2
|
export declare const useHotelDetails: (hotel: IHotelDetails) => {
|
|
3
3
|
transferPartners: any;
|
|
4
|
-
|
|
5
|
-
isTransferPartnersError: boolean;
|
|
4
|
+
loadingTransferPartners: boolean;
|
|
6
5
|
pointsRooms: import('../../main').IRoom[];
|
|
6
|
+
loadingLivePointsCheck: boolean;
|
|
7
7
|
cashRooms: import('../../main').IRoom[];
|
|
8
|
+
loadingCashRooms: boolean;
|
|
8
9
|
bestCheckout: import('./useHotelDetails.types').IBestCheckout | undefined;
|
|
10
|
+
loadingBestCheckout: boolean;
|
|
9
11
|
isAvailable: boolean;
|
|
10
12
|
pointsAsCash: import('../../utilities/pointsAsCashUtils').IPointsAsCash | undefined;
|
|
13
|
+
hotelDetails: IHotelDetails;
|
|
11
14
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function c(e) {
|
|
2
|
+
return e = e.replace(/^_+/, ""), e.replace(/_([a-z])/g, (r, a) => a.toUpperCase());
|
|
3
|
+
}
|
|
4
|
+
const t = (e) => Array.isArray(e) ? e.map((r) => t(r)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((r, a) => {
|
|
5
|
+
const n = c(a);
|
|
6
|
+
return r[n] = t(e[a]), r;
|
|
7
|
+
}, {}) : e;
|
|
8
|
+
export {
|
|
9
|
+
t as c
|
|
10
|
+
};
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import { N as d, c as h } from "../../awayzClient-Bs2isDLP.js";
|
|
7
|
-
import { EDuffelEndpoints as u } from "../../configs/endpoints.js";
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var p = (t, e, a) => e in t ? f(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
3
|
+
var c = (t, e, a) => p(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
+
import { clientInstance as d } from "@odynn/awayz-auth";
|
|
5
|
+
import { EDuffelEndpoints as h } from "../../configs/endpoints.js";
|
|
8
6
|
import "../../moment-BGjjqtLQ.js";
|
|
9
7
|
import "../../arrayExtensions-cyilNkdJ.js";
|
|
10
|
-
import {
|
|
8
|
+
import { c as u } from "../../objectUtils-CyIaVmog.js";
|
|
9
|
+
import { E as s } from "../../DateFormats-DZD30Nea.js";
|
|
11
10
|
var v = /* @__PURE__ */ ((t) => (t.Hotel = "awayz_hotel_booking_id", t.Flight = "awayz_flight_booking_id", t.Offer = "flight_offer_id", t))(v || {});
|
|
12
11
|
class g {
|
|
13
12
|
constructor() {
|
|
14
|
-
|
|
13
|
+
c(this, "getAvailableRooms", async ({
|
|
15
14
|
checkinDate: e,
|
|
16
15
|
checkoutDate: a,
|
|
17
16
|
accommodationId: i,
|
|
18
|
-
rooms:
|
|
19
|
-
guests:
|
|
17
|
+
rooms: n,
|
|
18
|
+
guests: m
|
|
20
19
|
}) => {
|
|
21
20
|
try {
|
|
22
21
|
const { data: o } = await d.post(
|
|
23
|
-
|
|
22
|
+
h.AVAILABLE_ROOMS,
|
|
24
23
|
{
|
|
25
|
-
check_in_date: e.format(
|
|
26
|
-
check_out_date: a.format(
|
|
24
|
+
check_in_date: e.format(s.ServerDate),
|
|
25
|
+
check_out_date: a.format(s.ServerDate),
|
|
27
26
|
accommodation_ids: [i],
|
|
28
|
-
rooms:
|
|
29
|
-
guests:
|
|
27
|
+
rooms: n,
|
|
28
|
+
guests: m
|
|
30
29
|
}
|
|
31
30
|
), r = o.data.results.getFirst(), _ = r.accommodation.rooms.map(
|
|
32
|
-
(l) =>
|
|
31
|
+
(l) => u(l)
|
|
33
32
|
);
|
|
34
33
|
return {
|
|
35
34
|
cheapestRate: parseFloat(r.cheapest_rate_total_amount),
|
|
@@ -45,8 +44,8 @@ class g {
|
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
|
-
const
|
|
47
|
+
const D = new g();
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
D as BookingService,
|
|
51
50
|
v as EBookingType
|
|
52
51
|
};
|