@odynn/awayz-core 0.3.20 → 0.3.22
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/CashValue/CashValue.js +198 -194
- package/dist/components/CashValue/CashValue.stories.js +28 -12
- package/dist/components/CashValue/CashValueTypes.js +3 -3
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +0 -1
- package/dist/lib/components/CashValue/CashValue.stories.d.ts +2 -0
- package/dist/lib/components/CashValue/CashValueTypes.d.ts +2 -0
- package/dist/lib/services/bookings/BookingService.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c, Fragment as rt, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { u as
|
|
5
|
-
import { r as
|
|
3
|
+
import { useMemo as nt } from "react";
|
|
4
|
+
import { u as D, a as ot, c as A, b as q, d as ve, e as st, f as it, g as G, o as at, s as lt, h as ct, i as dt, j as ut, k as pt, l as ft, m as ht, n as vt, p as mt, P as me } from "../../index-BC-KTkxU.js";
|
|
5
|
+
import { r as yt, R as gt } from "../../index-Cv-wvFlM.js";
|
|
6
6
|
import { b as ue } from "../../index-CDh8vAM_.js";
|
|
7
7
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
8
|
-
import { E as
|
|
9
|
-
import { useQuery as
|
|
10
|
-
import { CurrencyService as
|
|
8
|
+
import { E as Ct } from "../../AccountService-D_6U8vP6.js";
|
|
9
|
+
import { useQuery as Et } from "@tanstack/react-query";
|
|
10
|
+
import { CurrencyService as wt } from "../../services/currency/CurrencyService.js";
|
|
11
11
|
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
12
12
|
import "../../context/AwayzContext.js";
|
|
13
13
|
import "../../configs/awayzClient.js";
|
|
14
|
-
import { useAwayzContext as
|
|
14
|
+
import { useAwayzContext as Pt } from "../../hooks/useAwayzContext.js";
|
|
15
15
|
import "../../services/noRetryInstance.js";
|
|
16
|
-
import { EInvalidAmountDisplayOption as
|
|
16
|
+
import { EInvalidAmountDisplayOption as N, EToolTipPosition as bt } from "./CashValueTypes.js";
|
|
17
17
|
/* empty css */
|
|
18
18
|
/* empty css */
|
|
19
19
|
/* empty css */
|
|
20
20
|
/* empty css */
|
|
21
|
-
const
|
|
21
|
+
const Y = (e, t) => {
|
|
22
22
|
var r = new Intl.NumberFormat("en-US", {
|
|
23
23
|
style: "currency",
|
|
24
24
|
currency: t ?? "USD"
|
|
@@ -26,30 +26,30 @@ const j = (e, t) => {
|
|
|
26
26
|
if (!e) return r.format(0);
|
|
27
27
|
const o = parseFloat(e.toString());
|
|
28
28
|
return r.format(o);
|
|
29
|
-
},
|
|
30
|
-
if (e
|
|
29
|
+
}, pe = (e, t) => {
|
|
30
|
+
if (e < 0) return "N/A";
|
|
31
31
|
var r = new Intl.NumberFormat("en-US", {
|
|
32
32
|
style: "currency",
|
|
33
33
|
currency: t ?? "USD"
|
|
34
34
|
});
|
|
35
|
-
return
|
|
35
|
+
return r.format(Math.round(e)).toString().split(".")[0];
|
|
36
36
|
};
|
|
37
37
|
// @__NO_SIDE_EFFECTS__
|
|
38
38
|
function xt(e) {
|
|
39
39
|
const t = /* @__PURE__ */ Tt(e), r = i.forwardRef((o, n) => {
|
|
40
40
|
const { children: s, ...a } = o, u = i.Children.toArray(s), l = u.find(Rt);
|
|
41
41
|
if (l) {
|
|
42
|
-
const p = l.props.children,
|
|
43
|
-
return /* @__PURE__ */
|
|
42
|
+
const p = l.props.children, d = u.map((f) => f === l ? i.Children.count(p) > 1 ? i.Children.only(null) : i.isValidElement(p) ? p.props.children : null : f);
|
|
43
|
+
return /* @__PURE__ */ c(t, { ...a, ref: n, children: i.isValidElement(p) ? i.cloneElement(p, void 0, d) : null });
|
|
44
44
|
}
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ c(t, { ...a, ref: n, children: s });
|
|
46
46
|
});
|
|
47
47
|
return r.displayName = `${e}.Slot`, r;
|
|
48
48
|
}
|
|
49
49
|
// @__NO_SIDE_EFFECTS__
|
|
50
50
|
function Tt(e) {
|
|
51
51
|
const t = i.forwardRef((r, o) => {
|
|
52
|
-
const { children: n, ...s } = r, a = i.isValidElement(n) ? St(n) : void 0, u =
|
|
52
|
+
const { children: n, ...s } = r, a = i.isValidElement(n) ? St(n) : void 0, u = D(a, o);
|
|
53
53
|
if (i.isValidElement(n)) {
|
|
54
54
|
const l = Ot(s, n.props);
|
|
55
55
|
return n.type !== i.Fragment && (l.ref = u), i.cloneElement(n, l);
|
|
@@ -58,14 +58,14 @@ function Tt(e) {
|
|
|
58
58
|
});
|
|
59
59
|
return t.displayName = `${e}.SlotClone`, t;
|
|
60
60
|
}
|
|
61
|
-
var
|
|
61
|
+
var ye = Symbol("radix.slottable");
|
|
62
62
|
// @__NO_SIDE_EFFECTS__
|
|
63
63
|
function At(e) {
|
|
64
|
-
const t = ({ children: r }) => /* @__PURE__ */
|
|
65
|
-
return t.displayName = `${e}.Slottable`, t.__radixId =
|
|
64
|
+
const t = ({ children: r }) => /* @__PURE__ */ c(rt, { children: r });
|
|
65
|
+
return t.displayName = `${e}.Slottable`, t.__radixId = ye, t;
|
|
66
66
|
}
|
|
67
67
|
function Rt(e) {
|
|
68
|
-
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId ===
|
|
68
|
+
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ye;
|
|
69
69
|
}
|
|
70
70
|
function Ot(e, t) {
|
|
71
71
|
const r = { ...t };
|
|
@@ -104,18 +104,18 @@ var Nt = [
|
|
|
104
104
|
], O = Nt.reduce((e, t) => {
|
|
105
105
|
const r = /* @__PURE__ */ xt(`Primitive.${t}`), o = i.forwardRef((n, s) => {
|
|
106
106
|
const { asChild: a, ...u } = n, l = a ? r : t;
|
|
107
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
107
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c(l, { ...u, ref: s });
|
|
108
108
|
});
|
|
109
109
|
return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
|
|
110
110
|
}, {});
|
|
111
111
|
function Dt(e, t) {
|
|
112
|
-
e &&
|
|
112
|
+
e && yt.flushSync(() => e.dispatchEvent(t));
|
|
113
113
|
}
|
|
114
|
-
var _t = "DismissableLayer", z = "dismissableLayer.update", Lt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside",
|
|
114
|
+
var _t = "DismissableLayer", z = "dismissableLayer.update", Lt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside", fe, ge = i.createContext({
|
|
115
115
|
layers: /* @__PURE__ */ new Set(),
|
|
116
116
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
117
117
|
branches: /* @__PURE__ */ new Set()
|
|
118
|
-
}),
|
|
118
|
+
}), Ce = i.forwardRef(
|
|
119
119
|
(e, t) => {
|
|
120
120
|
const {
|
|
121
121
|
disableOutsidePointerEvents: r = !1,
|
|
@@ -125,26 +125,26 @@ var _t = "DismissableLayer", z = "dismissableLayer.update", Lt = "dismissableLay
|
|
|
125
125
|
onInteractOutside: a,
|
|
126
126
|
onDismiss: u,
|
|
127
127
|
...l
|
|
128
|
-
} = e, p = i.useContext(
|
|
129
|
-
const S = g.target, F = [...p.branches].some((
|
|
128
|
+
} = e, p = i.useContext(ge), [d, f] = i.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = i.useState({}), m = D(t, (g) => f(g)), y = Array.from(p.layers), [C] = [...p.layersWithOutsidePointerEventsDisabled].slice(-1), w = y.indexOf(C), E = d ? y.indexOf(d) : -1, x = p.layersWithOutsidePointerEventsDisabled.size > 0, P = E >= w, T = kt((g) => {
|
|
129
|
+
const S = g.target, F = [...p.branches].some((I) => I.contains(S));
|
|
130
130
|
!P || F || (n == null || n(g), a == null || a(g), g.defaultPrevented || u == null || u());
|
|
131
131
|
}, h), b = Ft((g) => {
|
|
132
132
|
const S = g.target;
|
|
133
|
-
[...p.branches].some((
|
|
133
|
+
[...p.branches].some((I) => I.contains(S)) || (s == null || s(g), a == null || a(g), g.defaultPrevented || u == null || u());
|
|
134
134
|
}, h);
|
|
135
|
-
return
|
|
136
|
-
|
|
135
|
+
return ot((g) => {
|
|
136
|
+
E === p.layers.size - 1 && (o == null || o(g), !g.defaultPrevented && u && (g.preventDefault(), u()));
|
|
137
137
|
}, h), i.useEffect(() => {
|
|
138
|
-
if (
|
|
139
|
-
return r && (p.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
140
|
-
r && p.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents =
|
|
138
|
+
if (d)
|
|
139
|
+
return r && (p.layersWithOutsidePointerEventsDisabled.size === 0 && (fe = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), p.layersWithOutsidePointerEventsDisabled.add(d)), p.layers.add(d), he(), () => {
|
|
140
|
+
r && p.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = fe);
|
|
141
141
|
};
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, [
|
|
142
|
+
}, [d, h, r, p]), i.useEffect(() => () => {
|
|
143
|
+
d && (p.layers.delete(d), p.layersWithOutsidePointerEventsDisabled.delete(d), he());
|
|
144
|
+
}, [d, p]), i.useEffect(() => {
|
|
145
145
|
const g = () => v({});
|
|
146
146
|
return document.addEventListener(z, g), () => document.removeEventListener(z, g);
|
|
147
|
-
}, []), /* @__PURE__ */
|
|
147
|
+
}, []), /* @__PURE__ */ c(
|
|
148
148
|
O.div,
|
|
149
149
|
{
|
|
150
150
|
...l,
|
|
@@ -163,26 +163,26 @@ var _t = "DismissableLayer", z = "dismissableLayer.update", Lt = "dismissableLay
|
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
|
-
|
|
166
|
+
Ce.displayName = _t;
|
|
167
167
|
var Mt = "DismissableLayerBranch", Ht = i.forwardRef((e, t) => {
|
|
168
|
-
const r = i.useContext(
|
|
168
|
+
const r = i.useContext(ge), o = i.useRef(null), n = D(t, o);
|
|
169
169
|
return i.useEffect(() => {
|
|
170
170
|
const s = o.current;
|
|
171
171
|
if (s)
|
|
172
172
|
return r.branches.add(s), () => {
|
|
173
173
|
r.branches.delete(s);
|
|
174
174
|
};
|
|
175
|
-
}, [r.branches]), /* @__PURE__ */
|
|
175
|
+
}, [r.branches]), /* @__PURE__ */ c(O.div, { ...e, ref: n });
|
|
176
176
|
});
|
|
177
177
|
Ht.displayName = Mt;
|
|
178
178
|
function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
179
|
-
const r =
|
|
179
|
+
const r = q(e), o = i.useRef(!1), n = i.useRef(() => {
|
|
180
180
|
});
|
|
181
181
|
return i.useEffect(() => {
|
|
182
182
|
const s = (u) => {
|
|
183
183
|
if (u.target && !o.current) {
|
|
184
184
|
let l = function() {
|
|
185
|
-
|
|
185
|
+
Ee(
|
|
186
186
|
Lt,
|
|
187
187
|
r,
|
|
188
188
|
p,
|
|
@@ -206,10 +206,10 @@ function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
209
|
-
const r =
|
|
209
|
+
const r = q(e), o = i.useRef(!1);
|
|
210
210
|
return i.useEffect(() => {
|
|
211
211
|
const n = (s) => {
|
|
212
|
-
s.target && !o.current &&
|
|
212
|
+
s.target && !o.current && Ee(It, r, { originalEvent: s }, {
|
|
213
213
|
discrete: !1
|
|
214
214
|
});
|
|
215
215
|
};
|
|
@@ -219,17 +219,17 @@ function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
219
219
|
onBlurCapture: () => o.current = !1
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function he() {
|
|
223
223
|
const e = new CustomEvent(z);
|
|
224
224
|
document.dispatchEvent(e);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Ee(e, t, r, { discrete: o }) {
|
|
227
227
|
const n = r.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: r });
|
|
228
228
|
t && n.addEventListener(e, t, { once: !0 }), o ? Dt(n, s) : n.dispatchEvent(s);
|
|
229
229
|
}
|
|
230
|
-
var $t = "Arrow",
|
|
230
|
+
var $t = "Arrow", we = i.forwardRef((e, t) => {
|
|
231
231
|
const { children: r, width: o = 10, height: n = 5, ...s } = e;
|
|
232
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ c(
|
|
233
233
|
O.svg,
|
|
234
234
|
{
|
|
235
235
|
...s,
|
|
@@ -238,26 +238,26 @@ var $t = "Arrow", Ce = i.forwardRef((e, t) => {
|
|
|
238
238
|
height: n,
|
|
239
239
|
viewBox: "0 0 30 10",
|
|
240
240
|
preserveAspectRatio: "none",
|
|
241
|
-
children: e.asChild ? r : /* @__PURE__ */
|
|
241
|
+
children: e.asChild ? r : /* @__PURE__ */ c("polygon", { points: "0,0 30,0 15,10" })
|
|
242
242
|
}
|
|
243
243
|
);
|
|
244
244
|
});
|
|
245
|
-
|
|
246
|
-
var Wt =
|
|
245
|
+
we.displayName = $t;
|
|
246
|
+
var Wt = we, K = "Popper", [Pe, be] = ve(K), [Bt, xe] = Pe(K), Te = (e) => {
|
|
247
247
|
const { __scopePopper: t, children: r } = e, [o, n] = i.useState(null);
|
|
248
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ c(Bt, { scope: t, anchor: o, onAnchorChange: n, children: r });
|
|
249
249
|
};
|
|
250
|
-
|
|
251
|
-
var
|
|
250
|
+
Te.displayName = K;
|
|
251
|
+
var Ae = "PopperAnchor", Re = i.forwardRef(
|
|
252
252
|
(e, t) => {
|
|
253
|
-
const { __scopePopper: r, virtualRef: o, ...n } = e, s =
|
|
253
|
+
const { __scopePopper: r, virtualRef: o, ...n } = e, s = xe(Ae, r), a = i.useRef(null), u = D(t, a);
|
|
254
254
|
return i.useEffect(() => {
|
|
255
255
|
s.onAnchorChange((o == null ? void 0 : o.current) || a.current);
|
|
256
|
-
}), o ? null : /* @__PURE__ */
|
|
256
|
+
}), o ? null : /* @__PURE__ */ c(O.div, { ...n, ref: u });
|
|
257
257
|
}
|
|
258
258
|
);
|
|
259
|
-
|
|
260
|
-
var Q = "PopperContent", [Ut,
|
|
259
|
+
Re.displayName = Ae;
|
|
260
|
+
var Q = "PopperContent", [Ut, Yt] = Pe(Q), Oe = i.forwardRef(
|
|
261
261
|
(e, t) => {
|
|
262
262
|
var oe, se, ie, ae, le, ce;
|
|
263
263
|
const {
|
|
@@ -269,55 +269,55 @@ var Q = "PopperContent", [Ut, Vt] = Ee(Q), Re = i.forwardRef(
|
|
|
269
269
|
arrowPadding: u = 0,
|
|
270
270
|
avoidCollisions: l = !0,
|
|
271
271
|
collisionBoundary: p = [],
|
|
272
|
-
collisionPadding:
|
|
272
|
+
collisionPadding: d = 0,
|
|
273
273
|
sticky: f = "partial",
|
|
274
274
|
hideWhenDetached: h = !1,
|
|
275
275
|
updatePositionStrategy: v = "optimized",
|
|
276
276
|
onPlaced: m,
|
|
277
277
|
...y
|
|
278
|
-
} = e,
|
|
279
|
-
padding:
|
|
278
|
+
} = e, C = xe(Q, r), [w, E] = i.useState(null), x = D(t, (M) => E(M)), [P, T] = i.useState(null), b = st(P), g = (b == null ? void 0 : b.width) ?? 0, S = (b == null ? void 0 : b.height) ?? 0, F = o + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, te = Array.isArray(p) ? p : [p], Ye = te.length > 0, $ = {
|
|
279
|
+
padding: I,
|
|
280
280
|
boundary: te.filter(jt),
|
|
281
281
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
282
|
-
altBoundary:
|
|
283
|
-
}, { refs: Ve, floatingStyles: re, placement:
|
|
282
|
+
altBoundary: Ye
|
|
283
|
+
}, { refs: Ve, floatingStyles: re, placement: je, isPositioned: W, middlewareData: _ } = it({
|
|
284
284
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
285
285
|
strategy: "fixed",
|
|
286
286
|
placement: F,
|
|
287
|
-
whileElementsMounted: (...
|
|
287
|
+
whileElementsMounted: (...M) => ht(...M, {
|
|
288
288
|
animationFrame: v === "always"
|
|
289
289
|
}),
|
|
290
290
|
elements: {
|
|
291
|
-
reference:
|
|
291
|
+
reference: C.anchor
|
|
292
292
|
},
|
|
293
293
|
middleware: [
|
|
294
|
-
|
|
295
|
-
l &&
|
|
294
|
+
at({ mainAxis: n + S, alignmentAxis: a }),
|
|
295
|
+
l && lt({
|
|
296
296
|
mainAxis: !0,
|
|
297
297
|
crossAxis: !1,
|
|
298
|
-
limiter: f === "partial" ?
|
|
298
|
+
limiter: f === "partial" ? ft() : void 0,
|
|
299
299
|
...$
|
|
300
300
|
}),
|
|
301
|
-
l &&
|
|
302
|
-
|
|
301
|
+
l && ct({ ...$ }),
|
|
302
|
+
dt({
|
|
303
303
|
...$,
|
|
304
|
-
apply: ({ elements:
|
|
305
|
-
const { width:
|
|
306
|
-
U.setProperty("--radix-popper-available-width", `${
|
|
304
|
+
apply: ({ elements: M, rects: de, availableWidth: Qe, availableHeight: Je }) => {
|
|
305
|
+
const { width: et, height: tt } = de.reference, U = M.floating.style;
|
|
306
|
+
U.setProperty("--radix-popper-available-width", `${Qe}px`), U.setProperty("--radix-popper-available-height", `${Je}px`), U.setProperty("--radix-popper-anchor-width", `${et}px`), U.setProperty("--radix-popper-anchor-height", `${tt}px`);
|
|
307
307
|
}
|
|
308
308
|
}),
|
|
309
|
-
P &&
|
|
309
|
+
P && ut({ element: P, padding: u }),
|
|
310
310
|
Gt({ arrowWidth: g, arrowHeight: S }),
|
|
311
|
-
h &&
|
|
311
|
+
h && pt({ strategy: "referenceHidden", ...$ })
|
|
312
312
|
]
|
|
313
|
-
}), [ne,
|
|
313
|
+
}), [ne, Ge] = De(je), B = q(m);
|
|
314
314
|
G(() => {
|
|
315
315
|
W && (B == null || B());
|
|
316
316
|
}, [W, B]);
|
|
317
|
-
const
|
|
317
|
+
const ze = (oe = _.arrow) == null ? void 0 : oe.x, Xe = (se = _.arrow) == null ? void 0 : se.y, Ze = ((ie = _.arrow) == null ? void 0 : ie.centerOffset) !== 0, [qe, Ke] = i.useState();
|
|
318
318
|
return G(() => {
|
|
319
|
-
|
|
320
|
-
}, [
|
|
319
|
+
w && Ke(window.getComputedStyle(w).zIndex);
|
|
320
|
+
}, [w]), /* @__PURE__ */ c(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
323
|
ref: Ve.setFloating,
|
|
@@ -329,32 +329,32 @@ var Q = "PopperContent", [Ut, Vt] = Ee(Q), Re = i.forwardRef(
|
|
|
329
329
|
minWidth: "max-content",
|
|
330
330
|
zIndex: qe,
|
|
331
331
|
"--radix-popper-transform-origin": [
|
|
332
|
-
(ae =
|
|
333
|
-
(le =
|
|
332
|
+
(ae = _.transformOrigin) == null ? void 0 : ae.x,
|
|
333
|
+
(le = _.transformOrigin) == null ? void 0 : le.y
|
|
334
334
|
].join(" "),
|
|
335
335
|
// hide the content if using the hide middleware and should be hidden
|
|
336
336
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
337
337
|
// as if the PopperContent isn't there at all
|
|
338
|
-
...((ce =
|
|
338
|
+
...((ce = _.hide) == null ? void 0 : ce.referenceHidden) && {
|
|
339
339
|
visibility: "hidden",
|
|
340
340
|
pointerEvents: "none"
|
|
341
341
|
}
|
|
342
342
|
},
|
|
343
343
|
dir: e.dir,
|
|
344
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ c(
|
|
345
345
|
Ut,
|
|
346
346
|
{
|
|
347
347
|
scope: r,
|
|
348
348
|
placedSide: ne,
|
|
349
349
|
onArrowChange: T,
|
|
350
|
-
arrowX:
|
|
351
|
-
arrowY:
|
|
352
|
-
shouldHideArrow:
|
|
353
|
-
children: /* @__PURE__ */
|
|
350
|
+
arrowX: ze,
|
|
351
|
+
arrowY: Xe,
|
|
352
|
+
shouldHideArrow: Ze,
|
|
353
|
+
children: /* @__PURE__ */ c(
|
|
354
354
|
O.div,
|
|
355
355
|
{
|
|
356
356
|
"data-side": ne,
|
|
357
|
-
"data-align":
|
|
357
|
+
"data-align": Ge,
|
|
358
358
|
...y,
|
|
359
359
|
ref: x,
|
|
360
360
|
style: {
|
|
@@ -371,19 +371,19 @@ var Q = "PopperContent", [Ut, Vt] = Ee(Q), Re = i.forwardRef(
|
|
|
371
371
|
);
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
|
-
|
|
375
|
-
var
|
|
374
|
+
Oe.displayName = Q;
|
|
375
|
+
var Se = "PopperArrow", Vt = {
|
|
376
376
|
top: "bottom",
|
|
377
377
|
right: "left",
|
|
378
378
|
bottom: "top",
|
|
379
379
|
left: "right"
|
|
380
|
-
},
|
|
381
|
-
const { __scopePopper: o, ...n } = t, s =
|
|
380
|
+
}, Ne = i.forwardRef(function(t, r) {
|
|
381
|
+
const { __scopePopper: o, ...n } = t, s = Yt(Se, o), a = Vt[s.placedSide];
|
|
382
382
|
return (
|
|
383
383
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
384
384
|
// doesn't report size as we'd expect on SVG elements.
|
|
385
385
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
386
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ c(
|
|
387
387
|
"span",
|
|
388
388
|
{
|
|
389
389
|
ref: s.onArrowChange,
|
|
@@ -406,7 +406,7 @@ var Oe = "PopperArrow", Yt = {
|
|
|
406
406
|
}[s.placedSide],
|
|
407
407
|
visibility: s.shouldHideArrow ? "hidden" : void 0
|
|
408
408
|
},
|
|
409
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ c(
|
|
410
410
|
Wt,
|
|
411
411
|
{
|
|
412
412
|
...n,
|
|
@@ -422,7 +422,7 @@ var Oe = "PopperArrow", Yt = {
|
|
|
422
422
|
)
|
|
423
423
|
);
|
|
424
424
|
});
|
|
425
|
-
|
|
425
|
+
Ne.displayName = Se;
|
|
426
426
|
function jt(e) {
|
|
427
427
|
return e !== null;
|
|
428
428
|
}
|
|
@@ -430,24 +430,24 @@ var Gt = (e) => ({
|
|
|
430
430
|
name: "transformOrigin",
|
|
431
431
|
options: e,
|
|
432
432
|
fn(t) {
|
|
433
|
-
var w, E
|
|
434
|
-
const { placement: r, rects: o, middlewareData: n } = t, a = ((
|
|
433
|
+
var C, w, E;
|
|
434
|
+
const { placement: r, rects: o, middlewareData: n } = t, a = ((C = n.arrow) == null ? void 0 : C.centerOffset) !== 0, u = a ? 0 : e.arrowWidth, l = a ? 0 : e.arrowHeight, [p, d] = De(r), f = { start: "0%", center: "50%", end: "100%" }[d], h = (((w = n.arrow) == null ? void 0 : w.x) ?? 0) + u / 2, v = (((E = n.arrow) == null ? void 0 : E.y) ?? 0) + l / 2;
|
|
435
435
|
let m = "", y = "";
|
|
436
436
|
return p === "bottom" ? (m = a ? f : `${h}px`, y = `${-l}px`) : p === "top" ? (m = a ? f : `${h}px`, y = `${o.floating.height + l}px`) : p === "right" ? (m = `${-l}px`, y = a ? f : `${v}px`) : p === "left" && (m = `${o.floating.width + l}px`, y = a ? f : `${v}px`), { data: { x: m, y } };
|
|
437
437
|
}
|
|
438
438
|
});
|
|
439
|
-
function
|
|
439
|
+
function De(e) {
|
|
440
440
|
const [t, r = "center"] = e.split("-");
|
|
441
441
|
return [t, r];
|
|
442
442
|
}
|
|
443
|
-
var zt =
|
|
443
|
+
var zt = Te, Xt = Re, Zt = Oe, qt = Ne, Kt = "Portal", _e = i.forwardRef((e, t) => {
|
|
444
444
|
var u;
|
|
445
445
|
const { container: r, ...o } = e, [n, s] = i.useState(!1);
|
|
446
446
|
G(() => s(!0), []);
|
|
447
447
|
const a = r || n && ((u = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : u.body);
|
|
448
|
-
return a ?
|
|
448
|
+
return a ? gt.createPortal(/* @__PURE__ */ c(O.div, { ...o, ref: t }), a) : null;
|
|
449
449
|
});
|
|
450
|
-
|
|
450
|
+
_e.displayName = Kt;
|
|
451
451
|
var Qt = Object.freeze({
|
|
452
452
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
453
453
|
position: "absolute",
|
|
@@ -460,8 +460,8 @@ var Qt = Object.freeze({
|
|
|
460
460
|
clip: "rect(0, 0, 0, 0)",
|
|
461
461
|
whiteSpace: "nowrap",
|
|
462
462
|
wordWrap: "normal"
|
|
463
|
-
}), Jt = "VisuallyHidden",
|
|
464
|
-
(e, t) => /* @__PURE__ */
|
|
463
|
+
}), Jt = "VisuallyHidden", Le = i.forwardRef(
|
|
464
|
+
(e, t) => /* @__PURE__ */ c(
|
|
465
465
|
O.span,
|
|
466
466
|
{
|
|
467
467
|
...e,
|
|
@@ -470,10 +470,10 @@ var Qt = Object.freeze({
|
|
|
470
470
|
}
|
|
471
471
|
)
|
|
472
472
|
);
|
|
473
|
-
|
|
474
|
-
var er =
|
|
475
|
-
|
|
476
|
-
]),
|
|
473
|
+
Le.displayName = Jt;
|
|
474
|
+
var er = Le, [V, Yr] = ve("Tooltip", [
|
|
475
|
+
be
|
|
476
|
+
]), j = be(), Ie = "TooltipProvider", tr = 700, X = "tooltip.open", [rr, J] = V(Ie), Me = (e) => {
|
|
477
477
|
const {
|
|
478
478
|
__scopeTooltip: t,
|
|
479
479
|
delayDuration: r = tr,
|
|
@@ -484,7 +484,7 @@ var er = _e, [V, Vr] = he("Tooltip", [
|
|
|
484
484
|
return i.useEffect(() => {
|
|
485
485
|
const p = l.current;
|
|
486
486
|
return () => window.clearTimeout(p);
|
|
487
|
-
}, []), /* @__PURE__ */
|
|
487
|
+
}, []), /* @__PURE__ */ c(
|
|
488
488
|
rr,
|
|
489
489
|
{
|
|
490
490
|
scope: t,
|
|
@@ -508,8 +508,8 @@ var er = _e, [V, Vr] = he("Tooltip", [
|
|
|
508
508
|
}
|
|
509
509
|
);
|
|
510
510
|
};
|
|
511
|
-
|
|
512
|
-
var H = "Tooltip", [nr, k] = V(H),
|
|
511
|
+
Me.displayName = Ie;
|
|
512
|
+
var H = "Tooltip", [nr, k] = V(H), He = (e) => {
|
|
513
513
|
const {
|
|
514
514
|
__scopeTooltip: t,
|
|
515
515
|
children: r,
|
|
@@ -518,32 +518,32 @@ var H = "Tooltip", [nr, k] = V(H), Me = (e) => {
|
|
|
518
518
|
onOpenChange: s,
|
|
519
519
|
disableHoverableContent: a,
|
|
520
520
|
delayDuration: u
|
|
521
|
-
} = e, l = J(H, e.__scopeTooltip), p =
|
|
521
|
+
} = e, l = J(H, e.__scopeTooltip), p = j(t), [d, f] = i.useState(null), h = vt(), v = i.useRef(0), m = a ?? l.disableHoverableContent, y = u ?? l.delayDuration, C = i.useRef(!1), [w, E] = mt({
|
|
522
522
|
prop: o,
|
|
523
523
|
defaultProp: n ?? !1,
|
|
524
524
|
onChange: (g) => {
|
|
525
525
|
g ? (l.onOpen(), document.dispatchEvent(new CustomEvent(X))) : l.onClose(), s == null || s(g);
|
|
526
526
|
},
|
|
527
527
|
caller: H
|
|
528
|
-
}), x = i.useMemo(() =>
|
|
529
|
-
window.clearTimeout(v.current), v.current = 0,
|
|
530
|
-
}, [
|
|
531
|
-
window.clearTimeout(v.current), v.current = 0,
|
|
532
|
-
}, [
|
|
528
|
+
}), x = i.useMemo(() => w ? C.current ? "delayed-open" : "instant-open" : "closed", [w]), P = i.useCallback(() => {
|
|
529
|
+
window.clearTimeout(v.current), v.current = 0, C.current = !1, E(!0);
|
|
530
|
+
}, [E]), T = i.useCallback(() => {
|
|
531
|
+
window.clearTimeout(v.current), v.current = 0, E(!1);
|
|
532
|
+
}, [E]), b = i.useCallback(() => {
|
|
533
533
|
window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
534
|
-
|
|
534
|
+
C.current = !0, E(!0), v.current = 0;
|
|
535
535
|
}, y);
|
|
536
|
-
}, [y,
|
|
536
|
+
}, [y, E]);
|
|
537
537
|
return i.useEffect(() => () => {
|
|
538
538
|
v.current && (window.clearTimeout(v.current), v.current = 0);
|
|
539
|
-
}, []), /* @__PURE__ */
|
|
539
|
+
}, []), /* @__PURE__ */ c(zt, { ...p, children: /* @__PURE__ */ c(
|
|
540
540
|
nr,
|
|
541
541
|
{
|
|
542
542
|
scope: t,
|
|
543
543
|
contentId: h,
|
|
544
|
-
open:
|
|
544
|
+
open: w,
|
|
545
545
|
stateAttribute: x,
|
|
546
|
-
trigger:
|
|
546
|
+
trigger: d,
|
|
547
547
|
onTriggerChange: f,
|
|
548
548
|
onTriggerEnter: i.useCallback(() => {
|
|
549
549
|
l.isOpenDelayedRef.current ? b() : P();
|
|
@@ -558,11 +558,11 @@ var H = "Tooltip", [nr, k] = V(H), Me = (e) => {
|
|
|
558
558
|
}
|
|
559
559
|
) });
|
|
560
560
|
};
|
|
561
|
-
|
|
562
|
-
var
|
|
561
|
+
He.displayName = H;
|
|
562
|
+
var Z = "TooltipTrigger", ke = i.forwardRef(
|
|
563
563
|
(e, t) => {
|
|
564
|
-
const { __scopeTooltip: r, ...o } = e, n = k(
|
|
565
|
-
return i.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */
|
|
564
|
+
const { __scopeTooltip: r, ...o } = e, n = k(Z, r), s = J(Z, r), a = j(r), u = i.useRef(null), l = D(t, u, n.onTriggerChange), p = i.useRef(!1), d = i.useRef(!1), f = i.useCallback(() => p.current = !1, []);
|
|
565
|
+
return i.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ c(Xt, { asChild: !0, ...a, children: /* @__PURE__ */ c(
|
|
566
566
|
O.button,
|
|
567
567
|
{
|
|
568
568
|
"aria-describedby": n.open ? n.contentId : void 0,
|
|
@@ -570,10 +570,10 @@ var q = "TooltipTrigger", He = i.forwardRef(
|
|
|
570
570
|
...o,
|
|
571
571
|
ref: l,
|
|
572
572
|
onPointerMove: A(e.onPointerMove, (h) => {
|
|
573
|
-
h.pointerType !== "touch" && !
|
|
573
|
+
h.pointerType !== "touch" && !d.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), d.current = !0);
|
|
574
574
|
}),
|
|
575
575
|
onPointerLeave: A(e.onPointerLeave, () => {
|
|
576
|
-
n.onTriggerLeave(),
|
|
576
|
+
n.onTriggerLeave(), d.current = !1;
|
|
577
577
|
}),
|
|
578
578
|
onPointerDown: A(e.onPointerDown, () => {
|
|
579
579
|
n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", f, { once: !0 });
|
|
@@ -587,46 +587,46 @@ var q = "TooltipTrigger", He = i.forwardRef(
|
|
|
587
587
|
) });
|
|
588
588
|
}
|
|
589
589
|
);
|
|
590
|
-
|
|
590
|
+
ke.displayName = Z;
|
|
591
591
|
var ee = "TooltipPortal", [or, sr] = V(ee, {
|
|
592
592
|
forceMount: void 0
|
|
593
|
-
}),
|
|
593
|
+
}), Fe = (e) => {
|
|
594
594
|
const { __scopeTooltip: t, forceMount: r, children: o, container: n } = e, s = k(ee, t);
|
|
595
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ c(or, { scope: t, forceMount: r, children: /* @__PURE__ */ c(me, { present: r || s.open, children: /* @__PURE__ */ c(_e, { asChild: !0, container: n, children: o }) }) });
|
|
596
596
|
};
|
|
597
|
-
|
|
598
|
-
var
|
|
597
|
+
Fe.displayName = ee;
|
|
598
|
+
var L = "TooltipContent", $e = i.forwardRef(
|
|
599
599
|
(e, t) => {
|
|
600
|
-
const r = sr(
|
|
601
|
-
return /* @__PURE__ */
|
|
600
|
+
const r = sr(L, e.__scopeTooltip), { forceMount: o = r.forceMount, side: n = "top", ...s } = e, a = k(L, e.__scopeTooltip);
|
|
601
|
+
return /* @__PURE__ */ c(me, { present: o || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(We, { side: n, ...s, ref: t }) : /* @__PURE__ */ c(ir, { side: n, ...s, ref: t }) });
|
|
602
602
|
}
|
|
603
603
|
), ir = i.forwardRef((e, t) => {
|
|
604
|
-
const r = k(
|
|
604
|
+
const r = k(L, e.__scopeTooltip), o = J(L, e.__scopeTooltip), n = i.useRef(null), s = D(t, n), [a, u] = i.useState(null), { trigger: l, onClose: p } = r, d = n.current, { onPointerInTransitChange: f } = o, h = i.useCallback(() => {
|
|
605
605
|
u(null), f(!1);
|
|
606
606
|
}, [f]), v = i.useCallback(
|
|
607
607
|
(m, y) => {
|
|
608
|
-
const
|
|
608
|
+
const C = m.currentTarget, w = { x: m.clientX, y: m.clientY }, E = dr(w, C.getBoundingClientRect()), x = ur(w, E), P = pr(y.getBoundingClientRect()), T = hr([...x, ...P]);
|
|
609
609
|
u(T), f(!0);
|
|
610
610
|
},
|
|
611
611
|
[f]
|
|
612
612
|
);
|
|
613
613
|
return i.useEffect(() => () => h(), [h]), i.useEffect(() => {
|
|
614
|
-
if (l &&
|
|
615
|
-
const m = (
|
|
616
|
-
return l.addEventListener("pointerleave", m),
|
|
617
|
-
l.removeEventListener("pointerleave", m),
|
|
614
|
+
if (l && d) {
|
|
615
|
+
const m = (C) => v(C, d), y = (C) => v(C, l);
|
|
616
|
+
return l.addEventListener("pointerleave", m), d.addEventListener("pointerleave", y), () => {
|
|
617
|
+
l.removeEventListener("pointerleave", m), d.removeEventListener("pointerleave", y);
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
}, [l,
|
|
620
|
+
}, [l, d, v, h]), i.useEffect(() => {
|
|
621
621
|
if (a) {
|
|
622
622
|
const m = (y) => {
|
|
623
|
-
const
|
|
624
|
-
|
|
623
|
+
const C = y.target, w = { x: y.clientX, y: y.clientY }, E = (l == null ? void 0 : l.contains(C)) || (d == null ? void 0 : d.contains(C)), x = !fr(w, a);
|
|
624
|
+
E ? h() : x && (h(), p());
|
|
625
625
|
};
|
|
626
626
|
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
627
627
|
}
|
|
628
|
-
}, [l,
|
|
629
|
-
}), [ar, lr] = V(H, { isInside: !1 }), cr = /* @__PURE__ */ At("TooltipContent"),
|
|
628
|
+
}, [l, d, a, p, h]), /* @__PURE__ */ c(We, { ...e, ref: s });
|
|
629
|
+
}), [ar, lr] = V(H, { isInside: !1 }), cr = /* @__PURE__ */ At("TooltipContent"), We = i.forwardRef(
|
|
630
630
|
(e, t) => {
|
|
631
631
|
const {
|
|
632
632
|
__scopeTooltip: r,
|
|
@@ -635,26 +635,26 @@ var _ = "TooltipContent", Fe = i.forwardRef(
|
|
|
635
635
|
onEscapeKeyDown: s,
|
|
636
636
|
onPointerDownOutside: a,
|
|
637
637
|
...u
|
|
638
|
-
} = e, l = k(
|
|
639
|
-
return i.useEffect(() => (document.addEventListener(X,
|
|
638
|
+
} = e, l = k(L, r), p = j(r), { onClose: d } = l;
|
|
639
|
+
return i.useEffect(() => (document.addEventListener(X, d), () => document.removeEventListener(X, d)), [d]), i.useEffect(() => {
|
|
640
640
|
if (l.trigger) {
|
|
641
641
|
const f = (h) => {
|
|
642
642
|
const v = h.target;
|
|
643
|
-
v != null && v.contains(l.trigger) &&
|
|
643
|
+
v != null && v.contains(l.trigger) && d();
|
|
644
644
|
};
|
|
645
645
|
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
646
646
|
}
|
|
647
|
-
}, [l.trigger,
|
|
648
|
-
|
|
647
|
+
}, [l.trigger, d]), /* @__PURE__ */ c(
|
|
648
|
+
Ce,
|
|
649
649
|
{
|
|
650
650
|
asChild: !0,
|
|
651
651
|
disableOutsidePointerEvents: !1,
|
|
652
652
|
onEscapeKeyDown: s,
|
|
653
653
|
onPointerDownOutside: a,
|
|
654
654
|
onFocusOutside: (f) => f.preventDefault(),
|
|
655
|
-
onDismiss:
|
|
655
|
+
onDismiss: d,
|
|
656
656
|
children: /* @__PURE__ */ R(
|
|
657
|
-
|
|
657
|
+
Zt,
|
|
658
658
|
{
|
|
659
659
|
"data-state": l.stateAttribute,
|
|
660
660
|
...p,
|
|
@@ -669,8 +669,8 @@ var _ = "TooltipContent", Fe = i.forwardRef(
|
|
|
669
669
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
670
670
|
},
|
|
671
671
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ c(cr, { children: o }),
|
|
673
|
+
/* @__PURE__ */ c(ar, { scope: r, isInside: !0, children: /* @__PURE__ */ c(er, { id: l.contentId, role: "tooltip", children: n || o }) })
|
|
674
674
|
]
|
|
675
675
|
}
|
|
676
676
|
)
|
|
@@ -678,17 +678,17 @@ var _ = "TooltipContent", Fe = i.forwardRef(
|
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
680
|
);
|
|
681
|
-
|
|
682
|
-
var
|
|
681
|
+
$e.displayName = L;
|
|
682
|
+
var Be = "TooltipArrow", Ue = i.forwardRef(
|
|
683
683
|
(e, t) => {
|
|
684
|
-
const { __scopeTooltip: r, ...o } = e, n =
|
|
684
|
+
const { __scopeTooltip: r, ...o } = e, n = j(r);
|
|
685
685
|
return lr(
|
|
686
|
-
|
|
686
|
+
Be,
|
|
687
687
|
r
|
|
688
|
-
).isInside ? null : /* @__PURE__ */
|
|
688
|
+
).isInside ? null : /* @__PURE__ */ c(qt, { ...n, ...o, ref: t });
|
|
689
689
|
}
|
|
690
690
|
);
|
|
691
|
-
|
|
691
|
+
Ue.displayName = Be;
|
|
692
692
|
function dr(e, t) {
|
|
693
693
|
const r = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), n = Math.abs(t.right - e.x), s = Math.abs(t.left - e.x);
|
|
694
694
|
switch (Math.min(r, o, n, s)) {
|
|
@@ -747,8 +747,8 @@ function fr(e, t) {
|
|
|
747
747
|
const { x: r, y: o } = e;
|
|
748
748
|
let n = !1;
|
|
749
749
|
for (let s = 0, a = t.length - 1; s < t.length; a = s++) {
|
|
750
|
-
const u = t[s], l = t[a], p = u.x,
|
|
751
|
-
|
|
750
|
+
const u = t[s], l = t[a], p = u.x, d = u.y, f = l.x, h = l.y;
|
|
751
|
+
d > o != h > o && r < (f - p) * (o - d) / (h - d) + p && (n = !n);
|
|
752
752
|
}
|
|
753
753
|
return n;
|
|
754
754
|
}
|
|
@@ -781,21 +781,21 @@ function vr(e) {
|
|
|
781
781
|
}
|
|
782
782
|
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);
|
|
783
783
|
}
|
|
784
|
-
var mr =
|
|
785
|
-
const Pr = 1e3 * 60 * 60,
|
|
784
|
+
var mr = Me, yr = He, gr = ke, Cr = Fe, Er = $e, wr = Ue;
|
|
785
|
+
const Pr = 1e3 * 60 * 60, Vr = ({
|
|
786
786
|
amount: e,
|
|
787
787
|
currency: t,
|
|
788
|
-
position: r =
|
|
789
|
-
zeroDisplayOption: o =
|
|
788
|
+
position: r = bt.RIGHT,
|
|
789
|
+
zeroDisplayOption: o = N.NA,
|
|
790
790
|
customDisplay: n
|
|
791
791
|
}) => {
|
|
792
792
|
var f;
|
|
793
|
-
const { user: s } =
|
|
794
|
-
queryKey: [
|
|
795
|
-
queryFn: () =>
|
|
793
|
+
const { user: s } = Pt(), a = (f = s == null ? void 0 : s.userRegion) == null ? void 0 : f.currency, u = a !== t, { data: l, isPending: p } = Et({
|
|
794
|
+
queryKey: [Ct.CONVERT_CURRENCY, t],
|
|
795
|
+
queryFn: () => wt.convertCurrency({ baseCurrency: t }),
|
|
796
796
|
enabled: u,
|
|
797
797
|
staleTime: Pr
|
|
798
|
-
}),
|
|
798
|
+
}), d = nt(() => {
|
|
799
799
|
if (!s)
|
|
800
800
|
return null;
|
|
801
801
|
let h = typeof e == "string" ? parseFloat(e) : e;
|
|
@@ -805,25 +805,29 @@ const Pr = 1e3 * 60 * 60, Yr = ({
|
|
|
805
805
|
}
|
|
806
806
|
return h;
|
|
807
807
|
}, [e, s, p, u, l]);
|
|
808
|
-
if (!a || !
|
|
808
|
+
if (!a || !d || d < 0)
|
|
809
809
|
switch (o) {
|
|
810
|
-
case
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
case
|
|
813
|
-
return /* @__PURE__ */
|
|
814
|
-
case
|
|
815
|
-
return /* @__PURE__ */
|
|
816
|
-
case
|
|
817
|
-
return /* @__PURE__ */
|
|
810
|
+
case N.NA:
|
|
811
|
+
return /* @__PURE__ */ c("span", { children: "N/A" });
|
|
812
|
+
case N.HIDDEN:
|
|
813
|
+
return /* @__PURE__ */ c("span", { className: "hidden", children: "N/A" });
|
|
814
|
+
case N.DISPLAY_AS_ZERO:
|
|
815
|
+
return /* @__PURE__ */ c("span", { children: "0" });
|
|
816
|
+
case N.DISPLAY_AS_ZERO_WITH_CURRENCY:
|
|
817
|
+
return /* @__PURE__ */ c("span", { children: Y(0, a ?? t) });
|
|
818
|
+
case N.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL:
|
|
819
|
+
return /* @__PURE__ */ c("span", { children: pe(0, a ?? t) });
|
|
820
|
+
case N.CUSTOM:
|
|
821
|
+
return /* @__PURE__ */ c("span", { children: d == 0 ? n : "N/A" });
|
|
818
822
|
default:
|
|
819
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ c("span", { children: "N/A" });
|
|
820
824
|
}
|
|
821
825
|
return /* @__PURE__ */ R("span", { className: "currency-conversion", children: [
|
|
822
|
-
|
|
823
|
-
u && /* @__PURE__ */
|
|
826
|
+
pe(d, a),
|
|
827
|
+
u && /* @__PURE__ */ c(
|
|
824
828
|
br,
|
|
825
829
|
{
|
|
826
|
-
trigger: /* @__PURE__ */
|
|
830
|
+
trigger: /* @__PURE__ */ c("sup", { children: /* @__PURE__ */ c(ue, {}) }),
|
|
827
831
|
position: r,
|
|
828
832
|
children: /* @__PURE__ */ R("div", { className: "currency-conversion-container", children: [
|
|
829
833
|
/* @__PURE__ */ R("p", { children: [
|
|
@@ -833,11 +837,11 @@ const Pr = 1e3 * 60 * 60, Yr = ({
|
|
|
833
837
|
a
|
|
834
838
|
] }),
|
|
835
839
|
/* @__PURE__ */ R("div", { className: "currency-conversion-amounts", children: [
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { children: Y(e, t) }) }),
|
|
841
|
+
/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { children: Y(d, a) }) }),
|
|
842
|
+
/* @__PURE__ */ c("span", { className: "conversion-icon", children: /* @__PURE__ */ c(ue, {}) })
|
|
839
843
|
] }),
|
|
840
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ c("div", { className: "currency-conversion-rate", children: /* @__PURE__ */ R("p", { children: [
|
|
841
845
|
"Current Rate:",
|
|
842
846
|
" ",
|
|
843
847
|
l ? (
|
|
@@ -848,28 +852,28 @@ const Pr = 1e3 * 60 * 60, Yr = ({
|
|
|
848
852
|
) : "N/A",
|
|
849
853
|
" ",
|
|
850
854
|
"≈ ",
|
|
851
|
-
|
|
855
|
+
Y(1, a)
|
|
852
856
|
] }) })
|
|
853
857
|
] })
|
|
854
858
|
}
|
|
855
859
|
)
|
|
856
860
|
] });
|
|
857
|
-
}, br = ({ children: e, trigger: t, position: r }) => /* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
|
|
861
|
+
}, br = ({ children: e, trigger: t, position: r }) => /* @__PURE__ */ c(mr, { delayDuration: 100, children: /* @__PURE__ */ R(yr, { children: [
|
|
862
|
+
/* @__PURE__ */ c(gr, { asChild: !0, children: t }),
|
|
863
|
+
/* @__PURE__ */ c(Cr, { children: /* @__PURE__ */ R(
|
|
864
|
+
Er,
|
|
861
865
|
{
|
|
862
866
|
className: `tooltip-content ${r}`,
|
|
863
867
|
side: r,
|
|
864
868
|
align: "center",
|
|
865
869
|
children: [
|
|
866
870
|
e,
|
|
867
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ c(wr, { className: "tooltip-arrow" })
|
|
868
872
|
]
|
|
869
873
|
}
|
|
870
874
|
) })
|
|
871
875
|
] }) });
|
|
872
876
|
export {
|
|
873
|
-
|
|
877
|
+
Vr as CashValue,
|
|
874
878
|
Pr as CurrencyCallStaleTimeMs
|
|
875
879
|
};
|
|
@@ -14,7 +14,7 @@ import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '..
|
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
/* empty css */
|
|
17
|
-
const
|
|
17
|
+
const f = {
|
|
18
18
|
title: "Core/Cash Value",
|
|
19
19
|
component: n,
|
|
20
20
|
parameters: {
|
|
@@ -56,32 +56,46 @@ const h = {
|
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
]
|
|
59
|
-
},
|
|
59
|
+
}, h = {
|
|
60
60
|
name: "Euro to Dollar Cash Value",
|
|
61
61
|
args: {
|
|
62
62
|
amount: 100,
|
|
63
63
|
currency: "EUR"
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, _ = {
|
|
66
66
|
name: "Invalid Amount",
|
|
67
67
|
args: {
|
|
68
68
|
amount: "invalid",
|
|
69
69
|
currency: "EUR"
|
|
70
70
|
}
|
|
71
|
-
},
|
|
71
|
+
}, v = {
|
|
72
72
|
name: "Zero Amount with Display as Zero",
|
|
73
73
|
args: {
|
|
74
74
|
amount: 0,
|
|
75
75
|
zeroDisplayOption: o.DISPLAY_AS_ZERO,
|
|
76
76
|
currency: "EUR"
|
|
77
77
|
}
|
|
78
|
-
},
|
|
78
|
+
}, I = {
|
|
79
|
+
name: "Zero Amount with Display as Zero With Currency",
|
|
80
|
+
args: {
|
|
81
|
+
amount: 0,
|
|
82
|
+
zeroDisplayOption: o.DISPLAY_AS_ZERO_WITH_CURRENCY,
|
|
83
|
+
currency: "EUR"
|
|
84
|
+
}
|
|
85
|
+
}, U = {
|
|
86
|
+
name: "Zero Amount with Display as Zero With Currency No Decimal",
|
|
87
|
+
args: {
|
|
88
|
+
amount: 0,
|
|
89
|
+
zeroDisplayOption: o.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL,
|
|
90
|
+
currency: "EUR"
|
|
91
|
+
}
|
|
92
|
+
}, b = {
|
|
79
93
|
name: "Negative Amount",
|
|
80
94
|
args: {
|
|
81
95
|
amount: -100,
|
|
82
96
|
currency: "EUR"
|
|
83
97
|
}
|
|
84
|
-
},
|
|
98
|
+
}, N = {
|
|
85
99
|
name: "Custom Zero Amount",
|
|
86
100
|
args: {
|
|
87
101
|
amount: 0,
|
|
@@ -91,10 +105,12 @@ const h = {
|
|
|
91
105
|
}
|
|
92
106
|
};
|
|
93
107
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
N as CustomZeroAmount,
|
|
109
|
+
h as Default,
|
|
110
|
+
_ as InvalidAmount,
|
|
111
|
+
b as NegativeAmount,
|
|
112
|
+
v as ZeroAmount,
|
|
113
|
+
I as ZeroCurrencyAmount,
|
|
114
|
+
U as ZeroCurrencyNoDecimalAmount,
|
|
115
|
+
f as default
|
|
100
116
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _ = /* @__PURE__ */ ((r) => (r.TOP = "top", r.BOTTOM = "bottom", r.RIGHT = "right", r.LEFT = "left", r))(_ || {}), e = /* @__PURE__ */ ((r) => (r.NA = "N/A", r.HIDDEN = "Hidden", r.DISPLAY_AS_ZERO = "Display as Zero", r.DISPLAY_AS_ZERO_WITH_CURRENCY = "Display as Zero with Currency", r.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL = "Display as Zero with Currency (No Decimal)", r.CUSTOM = "Custom", r))(e || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
e as EInvalidAmountDisplayOption,
|
|
4
|
+
_ as EToolTipPosition
|
|
5
5
|
};
|
|
@@ -32,5 +32,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
32
32
|
export declare const Default: Story;
|
|
33
33
|
export declare const InvalidAmount: Story;
|
|
34
34
|
export declare const ZeroAmount: Story;
|
|
35
|
+
export declare const ZeroCurrencyAmount: Story;
|
|
36
|
+
export declare const ZeroCurrencyNoDecimalAmount: Story;
|
|
35
37
|
export declare const NegativeAmount: Story;
|
|
36
38
|
export declare const CustomZeroAmount: Story;
|
|
@@ -25,5 +25,7 @@ export declare enum EInvalidAmountDisplayOption {
|
|
|
25
25
|
NA = "N/A",
|
|
26
26
|
HIDDEN = "Hidden",
|
|
27
27
|
DISPLAY_AS_ZERO = "Display as Zero",
|
|
28
|
+
DISPLAY_AS_ZERO_WITH_CURRENCY = "Display as Zero with Currency",
|
|
29
|
+
DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL = "Display as Zero with Currency (No Decimal)",
|
|
28
30
|
CUSTOM = "Custom"
|
|
29
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFlightBookingDetails, IHotelBookingDetails } from './BookingService.types';
|
|
2
2
|
declare class _BookingService {
|
|
3
|
-
getHotelBooking: (
|
|
3
|
+
getHotelBooking: (bookingId: string) => Promise<IHotelBookingDetails>;
|
|
4
4
|
getFlightBooking: (bookingId: string) => Promise<IFlightBookingDetails>;
|
|
5
5
|
initiateCancelFlightBooking: (bookingId: string) => Promise<any>;
|
|
6
6
|
confirmCancelFlightBooking: (bookingId: string) => Promise<any>;
|