@odynn/awayz-core 0.3.1 → 0.3.3
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/{AccountService-Ct4hShV-.js → AccountService-D_6U8vP6.js} +33 -32
- package/dist/TripsService-BGx--gfb.js +120 -0
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +7 -6
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +4 -3
- package/dist/components/CashValue/CashValue.js +8 -5
- package/dist/components/CashValue/CashValue.stories.js +18 -15
- package/dist/components/Menu/Menu.js +5 -4
- package/dist/components/index.js +9 -5
- package/dist/configs/baseUrl.js +8 -5
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +9 -9
- package/dist/hooks/useBookingManagement/useBookingManagement.js +19 -16
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +11 -8
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +20 -17
- package/dist/hooks/useTripManagement/useTripManagement.test.js +138 -89
- package/dist/hooks/useWallet/useWallet.js +17 -14
- package/dist/hooks/useWallet/useWallet.test.js +12 -9
- package/dist/lib/components/index.d.ts +2 -0
- package/dist/lib/configs/awayzConfig.d.ts +4 -0
- package/dist/lib/configs/baseUrl.d.ts +1 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/trips/TripService.types.d.ts +4 -68
- package/dist/main.js +30 -24
- package/dist/providers/AwayzProvider.js +19 -16
- package/dist/services/account/AccountService.js +1 -1
- package/dist/services/bookings/BookingService.js +1 -1
- package/dist/services/currency/CurrencyService.js +10 -7
- package/dist/services/index.js +9 -7
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +1 -1
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/trips/TripService.types.js +2 -7
- package/dist/services/trips/TripsService.js +5 -77
- package/dist/services/wallet/WalletService.js +1 -1
- package/package.json +1 -1
- /package/dist/assets/{FlightBooking.css → _styles2.css} +0 -0
- /package/dist/assets/{Menu.css → _styles3.css} +0 -0
- /package/dist/assets/{HotelBooking.css → _styles4.css} +0 -0
|
@@ -74,7 +74,7 @@ function Ke(e, t) {
|
|
|
74
74
|
return s;
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, $e = (e) => !v(e) && e !== q;
|
|
78
78
|
function fe() {
|
|
79
79
|
const { caseless: e } = $e(this) && this || {}, t = {}, n = (r, s) => {
|
|
80
80
|
const o = e && Ke(t, s) || s;
|
|
@@ -181,14 +181,14 @@ const Xt = (e) => {
|
|
|
181
181
|
return r;
|
|
182
182
|
};
|
|
183
183
|
return n(e, 0);
|
|
184
|
-
}, Yt = x("AsyncFunction"), Zt = (e) => e && (se(e) || _(e)) && _(e.then) && _(e.catch), Je = ((e, t) => e ? setImmediate : t ? ((n, r) => (
|
|
185
|
-
s ===
|
|
184
|
+
}, Yt = x("AsyncFunction"), Zt = (e) => e && (se(e) || _(e)) && _(e.then) && _(e.catch), Je = ((e, t) => e ? setImmediate : t ? ((n, r) => (q.addEventListener("message", ({ source: s, data: o }) => {
|
|
185
|
+
s === q && o === n && r.length && r.shift()();
|
|
186
186
|
}, !1), (s) => {
|
|
187
|
-
r.push(s),
|
|
187
|
+
r.push(s), q.postMessage(n, "*");
|
|
188
188
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
189
189
|
typeof setImmediate == "function",
|
|
190
|
-
_(
|
|
191
|
-
), Qt = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
190
|
+
_(q.postMessage)
|
|
191
|
+
), Qt = typeof queueMicrotask < "u" ? queueMicrotask.bind(q) : typeof process < "u" && process.nextTick || Je, en = (e) => e != null && _(e[te]), a = {
|
|
192
192
|
isArray: j,
|
|
193
193
|
isArrayBuffer: je,
|
|
194
194
|
isBuffer: yt,
|
|
@@ -237,7 +237,7 @@ const Xt = (e) => {
|
|
|
237
237
|
noop: Gt,
|
|
238
238
|
toFiniteNumber: Vt,
|
|
239
239
|
findKey: Ke,
|
|
240
|
-
global:
|
|
240
|
+
global: q,
|
|
241
241
|
isContextDefined: $e,
|
|
242
242
|
isSpecCompliantForm: Wt,
|
|
243
243
|
toJSONObject: Xt,
|
|
@@ -940,7 +940,7 @@ function nt(e, t, n) {
|
|
|
940
940
|
return e && (r || n == !1) ? kn(e, t) : t;
|
|
941
941
|
}
|
|
942
942
|
const xe = (e) => e instanceof N ? { ...e } : e;
|
|
943
|
-
function
|
|
943
|
+
function M(e, t) {
|
|
944
944
|
t = t || {};
|
|
945
945
|
const n = {};
|
|
946
946
|
function r(u, l, d, y) {
|
|
@@ -1005,7 +1005,7 @@ function H(e, t) {
|
|
|
1005
1005
|
}), n;
|
|
1006
1006
|
}
|
|
1007
1007
|
const rt = (e) => {
|
|
1008
|
-
const t =
|
|
1008
|
+
const t = M({}, e);
|
|
1009
1009
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1010
1010
|
t.headers = i = N.from(i), t.url = Ye(nt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
|
|
1011
1011
|
"Authorization",
|
|
@@ -1406,7 +1406,7 @@ const Z = {
|
|
|
1406
1406
|
assertOptions: Kn,
|
|
1407
1407
|
validators: ae
|
|
1408
1408
|
}, U = Z.validators;
|
|
1409
|
-
let
|
|
1409
|
+
let H = class {
|
|
1410
1410
|
constructor(t) {
|
|
1411
1411
|
this.defaults = t || {}, this.interceptors = {
|
|
1412
1412
|
request: new Ae(),
|
|
@@ -1439,7 +1439,7 @@ let q = class {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
_request(t, n) {
|
|
1442
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1442
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = M(this.defaults, n);
|
|
1443
1443
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1444
1444
|
r !== void 0 && Z.assertOptions(r, {
|
|
1445
1445
|
silentJSONParsing: U.transitional(U.boolean),
|
|
@@ -1501,14 +1501,14 @@ let q = class {
|
|
|
1501
1501
|
return l;
|
|
1502
1502
|
}
|
|
1503
1503
|
getUri(t) {
|
|
1504
|
-
t =
|
|
1504
|
+
t = M(this.defaults, t);
|
|
1505
1505
|
const n = nt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1506
1506
|
return Ye(n, t.params, t.paramsSerializer);
|
|
1507
1507
|
}
|
|
1508
1508
|
};
|
|
1509
1509
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1510
|
-
|
|
1511
|
-
return this.request(
|
|
1510
|
+
H.prototype[t] = function(n, r) {
|
|
1511
|
+
return this.request(M(r || {}, {
|
|
1512
1512
|
method: t,
|
|
1513
1513
|
url: n,
|
|
1514
1514
|
data: (r || {}).data
|
|
@@ -1518,7 +1518,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1518
1518
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1519
1519
|
function n(r) {
|
|
1520
1520
|
return function(o, i, c) {
|
|
1521
|
-
return this.request(
|
|
1521
|
+
return this.request(M(c || {}, {
|
|
1522
1522
|
method: t,
|
|
1523
1523
|
headers: r ? {
|
|
1524
1524
|
"Content-Type": "multipart/form-data"
|
|
@@ -1528,7 +1528,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1528
1528
|
}));
|
|
1529
1529
|
};
|
|
1530
1530
|
}
|
|
1531
|
-
|
|
1531
|
+
H.prototype[t] = n(), H.prototype[t + "Form"] = n(!0);
|
|
1532
1532
|
});
|
|
1533
1533
|
let $n = class ct {
|
|
1534
1534
|
constructor(t) {
|
|
@@ -1680,13 +1680,13 @@ Object.entries(Ee).forEach(([e, t]) => {
|
|
|
1680
1680
|
Ee[t] = e;
|
|
1681
1681
|
});
|
|
1682
1682
|
function ut(e) {
|
|
1683
|
-
const t = new
|
|
1684
|
-
return a.extend(n,
|
|
1685
|
-
return ut(
|
|
1683
|
+
const t = new H(e), n = He(H.prototype.request, t);
|
|
1684
|
+
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1685
|
+
return ut(M(e, s));
|
|
1686
1686
|
}, n;
|
|
1687
1687
|
}
|
|
1688
1688
|
const S = ut(G);
|
|
1689
|
-
S.Axios =
|
|
1689
|
+
S.Axios = H;
|
|
1690
1690
|
S.CanceledError = z;
|
|
1691
1691
|
S.CancelToken = $n;
|
|
1692
1692
|
S.isCancel = et;
|
|
@@ -1699,7 +1699,7 @@ S.all = function(t) {
|
|
|
1699
1699
|
};
|
|
1700
1700
|
S.spread = vn;
|
|
1701
1701
|
S.isAxiosError = Jn;
|
|
1702
|
-
S.mergeConfig =
|
|
1702
|
+
S.mergeConfig = M;
|
|
1703
1703
|
S.AxiosHeaders = N;
|
|
1704
1704
|
S.formToJSON = (e) => Qe(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1705
1705
|
S.getAdapter = it.getAdapter;
|
|
@@ -1718,7 +1718,7 @@ const {
|
|
|
1718
1718
|
spread: gr,
|
|
1719
1719
|
toFormData: br,
|
|
1720
1720
|
AxiosHeaders: Tr,
|
|
1721
|
-
HttpStatusCode:
|
|
1721
|
+
HttpStatusCode: B,
|
|
1722
1722
|
formToJSON: Or,
|
|
1723
1723
|
getAdapter: Ar,
|
|
1724
1724
|
mergeConfig: _r
|
|
@@ -1741,10 +1741,10 @@ const {
|
|
|
1741
1741
|
);
|
|
1742
1742
|
}, Yn = async (e, t, n, r, s) => {
|
|
1743
1743
|
var f, u, l;
|
|
1744
|
-
const o = t.config, i = localStorage.getItem(F.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) ||
|
|
1744
|
+
const o = t.config, i = localStorage.getItem(F.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) || B.InternalServerError;
|
|
1745
1745
|
if (!o || o.__retries === n)
|
|
1746
1746
|
throw t;
|
|
1747
|
-
if (c ===
|
|
1747
|
+
if (c === B.Unauthorized && o.url !== O.REFRESH_EMBED_TOKEN && o.url !== O.REFRESH_TOKEN && o.url !== O.SIGN_IN && o.url !== O.SIGN_UP) {
|
|
1748
1748
|
if (!i)
|
|
1749
1749
|
throw De(
|
|
1750
1750
|
"refresh_token",
|
|
@@ -1763,10 +1763,11 @@ const {
|
|
|
1763
1763
|
return (l = o.url) != null && l.includes(O.EXCHANGE_TOKEN) && "id_token" in w && (o.data = JSON.stringify({ idToken: w.id_token })), r = !1, o.headers && (o.headers.Authorization = `Bearer ${w.token}`), Le(e, null, w.token), s(o);
|
|
1764
1764
|
}
|
|
1765
1765
|
if ([
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1766
|
+
B.Unauthorized,
|
|
1767
|
+
B.Forbidden,
|
|
1768
|
+
B.InternalServerError,
|
|
1769
|
+
B.Conflict,
|
|
1770
|
+
B.NotFound
|
|
1770
1771
|
].includes(c) || (o.__retries || (o.__retries = 0), o.__retries += 1, o.__retries > n))
|
|
1771
1772
|
throw t;
|
|
1772
1773
|
return Xn(
|
|
@@ -2022,13 +2023,13 @@ export {
|
|
|
2022
2023
|
mt as a,
|
|
2023
2024
|
L as b,
|
|
2024
2025
|
C as c,
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2026
|
+
F as d,
|
|
2027
|
+
S as e,
|
|
2028
|
+
Gn as f,
|
|
2028
2029
|
Vn as g,
|
|
2029
2030
|
Yn as h,
|
|
2030
2031
|
Zn as i,
|
|
2031
|
-
|
|
2032
|
+
ge as j,
|
|
2032
2033
|
Wn as k,
|
|
2033
2034
|
Xn as l,
|
|
2034
2035
|
De as m,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var g = (a, e, s) => e in a ? _(a, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[e] = s;
|
|
3
|
+
var t = (a, e, s) => g(a, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { c as n, j as u, b as o, r as y } from "./AccountService-D_6U8vP6.js";
|
|
5
|
+
import { EBookingType as T } from "./services/trips/TripService.types.js";
|
|
6
|
+
import { EMyTripsEndpoints as i } from "./configs/endpoints.js";
|
|
7
|
+
import { h as c } from "./arrayExtensions-DlcBOj5a.js";
|
|
8
|
+
import "react";
|
|
9
|
+
const b = "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/";
|
|
10
|
+
class f {
|
|
11
|
+
constructor() {
|
|
12
|
+
t(this, "createTrip", async (e) => {
|
|
13
|
+
const { data: s } = await n.post(
|
|
14
|
+
i.TRIPS,
|
|
15
|
+
u(e)
|
|
16
|
+
);
|
|
17
|
+
return s;
|
|
18
|
+
});
|
|
19
|
+
t(this, "getTripsByStatus", async (e) => {
|
|
20
|
+
const { data: s } = await n.get(
|
|
21
|
+
i.TRIPS,
|
|
22
|
+
{
|
|
23
|
+
params: { status: e }
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
if (!(s != null && s.success))
|
|
27
|
+
return [];
|
|
28
|
+
const r = s.data.map((p) => ({
|
|
29
|
+
...p,
|
|
30
|
+
flightBookings: m(p.flight_bookings ?? []),
|
|
31
|
+
hotelBookings: l(p.hotel_bookings ?? [])
|
|
32
|
+
}));
|
|
33
|
+
return o(r);
|
|
34
|
+
});
|
|
35
|
+
t(this, "updateTrip", async (e, s) => {
|
|
36
|
+
const { data: r } = await n.put(
|
|
37
|
+
`${i.TRIPS}/${e}`,
|
|
38
|
+
y(u(s))
|
|
39
|
+
);
|
|
40
|
+
return r != null && r.success ? {
|
|
41
|
+
success: !0,
|
|
42
|
+
data: o(r.data),
|
|
43
|
+
message: "Trip updated successfully."
|
|
44
|
+
} : {
|
|
45
|
+
success: !1,
|
|
46
|
+
message: "An error occurred while trying to update the trip."
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
t(this, "deleteTrip", async (e) => {
|
|
50
|
+
const { data: s } = await n.delete(
|
|
51
|
+
`${i.TRIPS}/${e}`
|
|
52
|
+
);
|
|
53
|
+
return s;
|
|
54
|
+
});
|
|
55
|
+
t(this, "getUncategorisedBookings", async () => {
|
|
56
|
+
const { data: e } = await n.get(
|
|
57
|
+
i.UNCATEGORISED_BOOKINGS
|
|
58
|
+
);
|
|
59
|
+
return e != null && e.success ? {
|
|
60
|
+
flightBookings: m(e.data.flight_bookings ?? []),
|
|
61
|
+
hotelBookings: l(e.data.hotel_bookings ?? [])
|
|
62
|
+
} : {
|
|
63
|
+
flightBookings: [],
|
|
64
|
+
hotelBookings: []
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
t(this, "addBookingToTrip", async (e, s, r) => {
|
|
68
|
+
const { data: d } = await n.put(i.ADD_BOOKING, {
|
|
69
|
+
trip_id: e,
|
|
70
|
+
booking_id: s,
|
|
71
|
+
booking_type: r
|
|
72
|
+
});
|
|
73
|
+
return d.success;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const m = (a) => a.map(
|
|
78
|
+
(e) => o({
|
|
79
|
+
id: e._id,
|
|
80
|
+
reference: e.booking_reference,
|
|
81
|
+
startDate: c(e.departure_date),
|
|
82
|
+
endDate: c(e.arrival_date),
|
|
83
|
+
bookingType: T.FLIGHT,
|
|
84
|
+
airlines: e.slices.map((s) => ({
|
|
85
|
+
logo: b + ".svg",
|
|
86
|
+
name: s.carriers.operating[0]
|
|
87
|
+
})),
|
|
88
|
+
arrival: {
|
|
89
|
+
airportCode: e.slices[0].origin,
|
|
90
|
+
location: ""
|
|
91
|
+
},
|
|
92
|
+
departure: {
|
|
93
|
+
airportCode: e.slices.getLast().destination,
|
|
94
|
+
location: ""
|
|
95
|
+
},
|
|
96
|
+
class: e.slices[0].fare_brand_name,
|
|
97
|
+
passengers: e.passengers.length,
|
|
98
|
+
hasAirlineChanges: !1,
|
|
99
|
+
orderId: e.order_id,
|
|
100
|
+
type: e.type
|
|
101
|
+
})
|
|
102
|
+
), l = (a) => a.map(
|
|
103
|
+
(e) => o({
|
|
104
|
+
id: e._id,
|
|
105
|
+
reference: e.reference,
|
|
106
|
+
startDate: c(e.start_date),
|
|
107
|
+
endDate: c(e.end_date),
|
|
108
|
+
bookingType: T.HOTEL,
|
|
109
|
+
name: e.rooms[0].name,
|
|
110
|
+
image: e.images[0],
|
|
111
|
+
guests: e.number_of_guests,
|
|
112
|
+
address: Object.values(e.address).filter((s) => s).map((s) => s.trim()).join(", "),
|
|
113
|
+
rooms: e.rooms.length,
|
|
114
|
+
bookingId: e.booking_id
|
|
115
|
+
})
|
|
116
|
+
), k = new f();
|
|
117
|
+
export {
|
|
118
|
+
b as D,
|
|
119
|
+
k as T
|
|
120
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { F as g } from "../../../index-COgXcb6p.js";
|
|
3
|
+
import '../../../assets/_styles2.css';/* empty css */
|
|
3
4
|
import { h as n } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
5
|
import { E as t } from "../../../DateFormats-DZD30Nea.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import f from "../../Menu/Menu.js";
|
|
7
|
-
|
|
8
|
+
const j = ({
|
|
8
9
|
airlines: c,
|
|
9
10
|
departure: d,
|
|
10
11
|
arrival: l,
|
|
11
|
-
bookingRef:
|
|
12
|
+
bookingRef: h,
|
|
12
13
|
flightClass: p,
|
|
13
14
|
numberOfPassengers: v,
|
|
14
15
|
cancelledAt: s,
|
|
@@ -16,7 +17,7 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
16
17
|
onClick: N,
|
|
17
18
|
contextOptions: r = []
|
|
18
19
|
}) => {
|
|
19
|
-
var
|
|
20
|
+
var m;
|
|
20
21
|
return /* @__PURE__ */ e("div", { className: "selected-flight-card", onClick: N, children: /* @__PURE__ */ i("div", { className: "content", children: [
|
|
21
22
|
/* @__PURE__ */ i("div", { className: "top-section", children: [
|
|
22
23
|
/* @__PURE__ */ i("div", { className: "header", children: [
|
|
@@ -59,7 +60,7 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
59
60
|
s && /* @__PURE__ */ e("div", { className: "cancelled-notice", children: /* @__PURE__ */ i("p", { children: [
|
|
60
61
|
"Cancelled:",
|
|
61
62
|
" ",
|
|
62
|
-
(
|
|
63
|
+
(m = n(s)) == null ? void 0 : m.format(
|
|
63
64
|
t.USStringDateFormat
|
|
64
65
|
)
|
|
65
66
|
] }) }),
|
|
@@ -68,7 +69,7 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
68
69
|
/* @__PURE__ */ i("div", { className: "bottom-header", children: [
|
|
69
70
|
/* @__PURE__ */ e("p", { children: "Booking Confirmation" }),
|
|
70
71
|
" ",
|
|
71
|
-
/* @__PURE__ */ e("div", { className: "id-and-icon", children: /* @__PURE__ */ e("span", { children:
|
|
72
|
+
/* @__PURE__ */ e("div", { className: "id-and-icon", children: /* @__PURE__ */ e("span", { children: h }) })
|
|
72
73
|
] }),
|
|
73
74
|
/* @__PURE__ */ i("div", { className: "bottom-section-details", children: [
|
|
74
75
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -84,5 +85,5 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
84
85
|
] }) });
|
|
85
86
|
};
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
j as FlightBooking
|
|
88
89
|
};
|
|
@@ -3,12 +3,13 @@ import { G as g } from "../../../index-COgXcb6p.js";
|
|
|
3
3
|
import { h as k } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { E as N } from "../../../DateFormats-DZD30Nea.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import '../../../assets/_styles4.css';/* empty css */
|
|
6
7
|
import u from "../../Menu/Menu.js";
|
|
7
|
-
|
|
8
|
+
const c = (r, o, t = o + "s") => r === 1 ? o : t;
|
|
8
9
|
function $(r) {
|
|
9
10
|
return g({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }, child: [] }, { tag: "circle", attr: { cx: "12", cy: "10", r: "3" }, child: [] }] })(r);
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const B = ({
|
|
12
13
|
hotelName: r,
|
|
13
14
|
address: o,
|
|
14
15
|
hotelImage: t,
|
|
@@ -71,5 +72,5 @@ const y = ({
|
|
|
71
72
|
] });
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
B as HotelBooking
|
|
75
76
|
};
|
|
@@ -4,15 +4,18 @@ import { useMemo as rt } from "react";
|
|
|
4
4
|
import { u as N, a as nt, c as A, b as Z, d as he, e as ot, f as st, g as G, o as it, s as at, h as lt, i as ct, j as dt, k as ut, l as pt, m as ft, n as ht, p as vt, P as ve, q as ue } from "../../index-COgXcb6p.js";
|
|
5
5
|
import { r as mt, R as yt } from "../../index-Cv-wvFlM.js";
|
|
6
6
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
7
|
-
import { E as gt } from "../../AccountService-
|
|
7
|
+
import { E as gt } from "../../AccountService-D_6U8vP6.js";
|
|
8
8
|
import { useQuery as wt } from "@tanstack/react-query";
|
|
9
9
|
import { CurrencyService as Ct } from "../../services/currency/CurrencyService.js";
|
|
10
|
-
import '../../assets/_styles.css';/* empty css */
|
|
10
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
11
|
import "../../context/AwayzContext.js";
|
|
12
12
|
import "../../configs/awayzClient.js";
|
|
13
13
|
import { useAwayzContext as Et } from "../../hooks/useAwayzContext.js";
|
|
14
14
|
import "../../services/noRetryInstance.js";
|
|
15
15
|
import { EInvalidAmountDisplayOption as M, EToolTipPosition as Pt } from "./CashValueTypes.js";
|
|
16
|
+
/* empty css */
|
|
17
|
+
/* empty css */
|
|
18
|
+
/* empty css */
|
|
16
19
|
const j = (e, t) => {
|
|
17
20
|
var r = new Intl.NumberFormat("en-US", {
|
|
18
21
|
style: "currency",
|
|
@@ -466,7 +469,7 @@ var Qt = Object.freeze({
|
|
|
466
469
|
)
|
|
467
470
|
);
|
|
468
471
|
_e.displayName = Jt;
|
|
469
|
-
var er = _e, [V,
|
|
472
|
+
var er = _e, [V, Br] = he("Tooltip", [
|
|
470
473
|
Pe
|
|
471
474
|
]), Y = Pe(), Le = "TooltipProvider", tr = 700, X = "tooltip.open", [rr, J] = V(Le), Ie = (e) => {
|
|
472
475
|
const {
|
|
@@ -777,7 +780,7 @@ function vr(e) {
|
|
|
777
780
|
return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
|
|
778
781
|
}
|
|
779
782
|
var mr = Ie, yr = Me, gr = He, wr = ke, Cr = Fe, Er = Be;
|
|
780
|
-
const Pr = 1e3 * 60 * 60,
|
|
783
|
+
const Pr = 1e3 * 60 * 60, Ur = ({
|
|
781
784
|
amount: e,
|
|
782
785
|
currency: t,
|
|
783
786
|
position: r = Pt.RIGHT,
|
|
@@ -865,6 +868,6 @@ const Pr = 1e3 * 60 * 60, $r = ({
|
|
|
865
868
|
) })
|
|
866
869
|
] }) });
|
|
867
870
|
export {
|
|
868
|
-
|
|
871
|
+
Ur as CashValue,
|
|
869
872
|
Pr as CurrencyCallStaleTimeMs
|
|
870
873
|
};
|
|
@@ -4,13 +4,16 @@ import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
|
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../context/AwayzContext.js";
|
|
6
6
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
7
|
-
import "../../AccountService-
|
|
7
|
+
import "../../AccountService-D_6U8vP6.js";
|
|
8
8
|
import "../../configs/awayzClient.js";
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
|
-
import { EAuthFlow as
|
|
10
|
+
import { EAuthFlow as i } from "../../types/EAuthFlow.js";
|
|
11
11
|
import "../../services/noRetryInstance.js";
|
|
12
12
|
import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
|
|
13
|
-
|
|
13
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
const b = {
|
|
14
17
|
title: "Core/Cash Value",
|
|
15
18
|
component: n,
|
|
16
19
|
parameters: {
|
|
@@ -42,7 +45,7 @@ const v = {
|
|
|
42
45
|
a,
|
|
43
46
|
{
|
|
44
47
|
config: {
|
|
45
|
-
authFlow:
|
|
48
|
+
authFlow: i.STANDARD,
|
|
46
49
|
clientId: void 0,
|
|
47
50
|
trustedOrigins: ["*"],
|
|
48
51
|
testMode: !0,
|
|
@@ -52,32 +55,32 @@ const v = {
|
|
|
52
55
|
}
|
|
53
56
|
)
|
|
54
57
|
]
|
|
55
|
-
},
|
|
58
|
+
}, h = {
|
|
56
59
|
name: "Euro to Dollar Cash Value",
|
|
57
60
|
args: {
|
|
58
61
|
amount: 100,
|
|
59
62
|
currency: "EUR"
|
|
60
63
|
}
|
|
61
|
-
},
|
|
64
|
+
}, R = {
|
|
62
65
|
name: "Invalid Amount",
|
|
63
66
|
args: {
|
|
64
67
|
amount: "invalid",
|
|
65
68
|
currency: "EUR"
|
|
66
69
|
}
|
|
67
|
-
},
|
|
70
|
+
}, j = {
|
|
68
71
|
name: "Zero Amount with Display as Zero",
|
|
69
72
|
args: {
|
|
70
73
|
amount: 0,
|
|
71
74
|
zeroDisplayOption: o.DISPLAY_AS_ZERO,
|
|
72
75
|
currency: "EUR"
|
|
73
76
|
}
|
|
74
|
-
},
|
|
77
|
+
}, C = {
|
|
75
78
|
name: "Negative Amount",
|
|
76
79
|
args: {
|
|
77
80
|
amount: -100,
|
|
78
81
|
currency: "EUR"
|
|
79
82
|
}
|
|
80
|
-
},
|
|
83
|
+
}, T = {
|
|
81
84
|
name: "Custom Zero Amount",
|
|
82
85
|
args: {
|
|
83
86
|
amount: 0,
|
|
@@ -87,10 +90,10 @@ const v = {
|
|
|
87
90
|
}
|
|
88
91
|
};
|
|
89
92
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
T as CustomZeroAmount,
|
|
94
|
+
h as Default,
|
|
95
|
+
R as InvalidAmount,
|
|
96
|
+
C as NegativeAmount,
|
|
97
|
+
j as ZeroAmount,
|
|
98
|
+
b as default
|
|
96
99
|
};
|
|
@@ -3,7 +3,8 @@ import * as a from "react";
|
|
|
3
3
|
import Z, { useState as or } from "react";
|
|
4
4
|
import { r as ie, d as me, u as T, a as ar, c as R, b as U, e as ir, f as cr, g as Ue, o as sr, s as ur, h as lr, i as dr, j as fr, k as pr, l as vr, m as mr, n as oe, p as Qe, P as Oe, t as hr, v as gr } from "../../index-COgXcb6p.js";
|
|
5
5
|
import { r as br, R as yr } from "../../index-Cv-wvFlM.js";
|
|
6
|
-
import '../../assets/
|
|
6
|
+
import '../../assets/_styles3.css';/* empty css */
|
|
7
|
+
// @__NO_SIDE_EFFECTS__
|
|
7
8
|
function ht(e) {
|
|
8
9
|
const t = /* @__PURE__ */ Cr(e), n = a.forwardRef((r, o) => {
|
|
9
10
|
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(Sr);
|
|
@@ -2128,7 +2129,7 @@ var pi = [
|
|
|
2128
2129
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
2129
2130
|
});
|
|
2130
2131
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
2131
|
-
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn,
|
|
2132
|
+
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn, qi] = me(Ce, [
|
|
2132
2133
|
mi,
|
|
2133
2134
|
Ne
|
|
2134
2135
|
]), A = wa(), Vn = Ne(), [hi, dt] = Kn(Ce), Gn = a.forwardRef(
|
|
@@ -2436,7 +2437,7 @@ function $i(e, t) {
|
|
|
2436
2437
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
2437
2438
|
}
|
|
2438
2439
|
var Bi = Gn, Wi = Hn, Ki = jn, xt = Yn, Vi = Xn, Ot = zn, Gi = qn, Ui = Qn, Hi = Jn;
|
|
2439
|
-
const
|
|
2440
|
+
const Qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root", children: /* @__PURE__ */ Fe(Wi, { children: [
|
|
2440
2441
|
/* @__PURE__ */ f(Ki, { className: "menubar-trigger", children: /* @__PURE__ */ f(hr, {}) }),
|
|
2441
2442
|
/* @__PURE__ */ f(xt, { children: /* @__PURE__ */ f(
|
|
2442
2443
|
Vi,
|
|
@@ -2487,5 +2488,5 @@ const qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root"
|
|
|
2487
2488
|
) })
|
|
2488
2489
|
] }) });
|
|
2489
2490
|
export {
|
|
2490
|
-
|
|
2491
|
+
Qi as default
|
|
2491
2492
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { CashValue as
|
|
2
|
-
import { EInvalidAmountDisplayOption as
|
|
1
|
+
import { CashValue as t } from "./CashValue/CashValue.js";
|
|
2
|
+
import { EInvalidAmountDisplayOption as p, EToolTipPosition as e } from "./CashValue/CashValueTypes.js";
|
|
3
|
+
import { FlightBooking as n } from "./Bookings/FlightBooking/FlightBooking.js";
|
|
4
|
+
import { HotelBooking as a } from "./Bookings/HotelBooking/HotelBooking.js";
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
t as CashValue,
|
|
7
|
+
p as EInvalidAmountDisplayOption,
|
|
8
|
+
e as EToolTipPosition,
|
|
9
|
+
n as FlightBooking,
|
|
10
|
+
a as HotelBooking
|
|
7
11
|
};
|
package/dist/configs/baseUrl.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
let
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
let s = "";
|
|
2
|
+
const e = () => s, n = (t) => {
|
|
3
|
+
s = t ? "https://appdev.odynn.info:3003" : "https://app.odynn.info";
|
|
4
|
+
}, o = (t) => {
|
|
5
|
+
s = t;
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
e as getBaseUrl,
|
|
9
|
+
n as setBaseUrl,
|
|
10
|
+
o as setCustomBaseUrl
|
|
8
11
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
2
|
-
import {
|
|
2
|
+
import { f as U, d as r, A as o, E as v } from "../../AccountService-D_6U8vP6.js";
|
|
3
3
|
import { useState as E, useCallback as R, useEffect as y } from "react";
|
|
4
4
|
import { EAuthFlow as S } from "../../types/EAuthFlow.js";
|
|
5
5
|
import { awayzClient as A } from "../../configs/awayzClient.js";
|
|
6
6
|
const H = (s, t) => {
|
|
7
|
-
var f,
|
|
8
|
-
let c = "",
|
|
9
|
-
typeof t == "string" ? c = t : t instanceof U ? (c = t.message,
|
|
7
|
+
var f, m;
|
|
8
|
+
let c = "", d = t;
|
|
9
|
+
typeof t == "string" ? c = t : t instanceof U ? (c = t.message, d = {
|
|
10
10
|
message: t.message,
|
|
11
11
|
cause: t.cause,
|
|
12
12
|
status: t.status,
|
|
13
13
|
data: (f = t == null ? void 0 : t.response) == null ? void 0 : f.data
|
|
14
|
-
}) : c = t.message, (
|
|
14
|
+
}) : c = t.message, (m = window.parent) == null || m.postMessage(
|
|
15
15
|
{
|
|
16
16
|
type: "auth_error",
|
|
17
|
-
details: { message: c, action: s, info:
|
|
17
|
+
details: { message: c, action: s, info: d }
|
|
18
18
|
},
|
|
19
19
|
"*"
|
|
20
20
|
);
|
|
21
21
|
}, G = (s) => {
|
|
22
|
-
const [t, c] = E(!0), [
|
|
22
|
+
const [t, c] = E(!0), [d, f] = E(!1), [m, T] = E(), [O, k] = E(), [I, K] = E([]), w = R(
|
|
23
23
|
async (a) => {
|
|
24
24
|
s != null && s.onSuccess && (s == null || s.onSuccess(a)), s != null && s.onSuccessAsync && await (s == null ? void 0 : s.onSuccessAsync(a)), c(!1), f(!0), T(a.token), k(a.user), A.invalidateQueries();
|
|
25
25
|
},
|
|
@@ -136,8 +136,8 @@ const H = (s, t) => {
|
|
|
136
136
|
};
|
|
137
137
|
}, []), {
|
|
138
138
|
isAuthenticating: t,
|
|
139
|
-
isAuthenticated:
|
|
140
|
-
token:
|
|
139
|
+
isAuthenticated: d,
|
|
140
|
+
token: m,
|
|
141
141
|
user: O,
|
|
142
142
|
supportedRegions: I,
|
|
143
143
|
signIn: async (a) => {
|